You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simplest way to convert from a url::Url to a http::Uri currently is to turn it into a string and then parse it again. It would be helpful if there was an API to do this conversion directly, instead of necessitating another round of parsing
Proposal
With a feature flag called http, the dependency http can be added.
When the http feature is active, a function can be exposed which does the conversion from url's internal structure to that of http::Uri's.
The text was updated successfully, but these errors were encountered:
I'm not totally convinced this is something that belongs in the url crate.
I'd rather keep dependencies to a minimal, and even if this is behind a feature gate, it still needs CI testing.
I would suggest a crate that depends on both rust-url and http that uses Builder to create a new http uri from parts.
I understand your concerns, perhaps a Builder API for this crate may be more helpful then, so that the conversion could be done both ways relatively efficiently.
Are URIs truly deprecated in some sense? The URL standard by WHATWG claims that a single algorithm is used for both and that they aim to deprecate URIs as a term in favor of URL, but I don't quite get how that could be possible when URIs are a superset of URLs.
Rationale
The simplest way to convert from a
url::Url
to ahttp::Uri
currently is to turn it into a string and then parse it again. It would be helpful if there was an API to do this conversion directly, instead of necessitating another round of parsingProposal
With a feature flag called
http
, the dependencyhttp
can be added.When the
http
feature is active, a function can be exposed which does the conversion fromurl
's internal structure to that ofhttp::Uri
's.The text was updated successfully, but these errors were encountered: