Closed davidbarsky closed 1 year ago
(cc: @seanmonstar.)
Relevant discussion about why this hasn't been implemented in the past: https://github.com/hyperium/http/issues/73
@seanmonstar Thanks for the background context. There are a few circumstances—namely, the AWS use-case—where I am constructing full URLs, not just URI fragments that compose into a target of an HTTP request. I think this PR implements the relatively conservative conversions as outlined in Carl's comment: https://github.com/hyperium/http/issues/73#issuecomment-319422772.
Not sure if any decision have been made on this PR but I think something along the lines of https://github.com/hyperium/http/pull/276 would address some of the goals of this PR. I'd be happy to revive #276.
(cc: @carllerche.)
Motivation
application/x-www-form-urlencoded
-based RPC calls. While this encoding is typically handled by the SDKs, this code needs to exist somewhere.TryFrom
conversion fromurl::Url
allows for building complex queries usingurl::Url
's builder methods, but then converting tohttp::Uri
at request construction time.http
's builders implement accept aTryFrom<T>
(inhttp::request::Builder
's case, aUri: TryFrom<T>
), this feature allows for passing aurl::Url
into a request builder.