Struct ureq::RequestUrl [−][src]
pub struct RequestUrl { /* fields omitted */ }
Parsed result of a request url with handy inspection methods.
Implementations
impl RequestUrl
[src]
impl RequestUrl
[src]pub fn as_url(&self) -> &Url
[src]
Handle the request url as a standard url::Url
.
pub fn scheme(&self) -> &str
[src]
Get the scheme of the request url, i.e. “https” or “http”.
pub fn host(&self) -> &str
[src]
Host of the request url.
pub fn port(&self) -> Option<u16>
[src]
Port of the request url, if available. Ports are only available if they
are present in the original url. Specifically the scheme default ports,
443 for https
and and 80 for http
are None
unless explicitly
set in the url, i.e. https://my-host.com:443/some/path
.
pub fn path(&self) -> &str
[src]
Path of the request url.
pub fn query_pairs(&self) -> Vec<(&str, &str)>
[src]
Returns all query parameters as a vector of key-value pairs.
let req = ureq::get("http://httpbin.org/get") .query("foo", "42") .query("foo", "43"); assert_eq!(req.request_url().unwrap().query_pairs(), vec![ ("foo", "42"), ("foo", "43") ]);
Trait Implementations
impl Clone for RequestUrl
[src]
impl Clone for RequestUrl
[src]fn clone(&self) -> RequestUrl
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for RequestUrl
impl RefUnwindSafe for RequestUrl
impl Send for RequestUrl
impl Send for RequestUrl
impl Sync for RequestUrl
impl Sync for RequestUrl
impl Unpin for RequestUrl
impl Unpin for RequestUrl
impl UnwindSafe for RequestUrl
impl UnwindSafe for RequestUrl