Struct ureq::RequestUrl [−][src]
Parsed result of a request url with handy inspection methods.
Implementations
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]
fn clone(&self) -> RequestUrl
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RequestUrl
[src]
Auto Trait Implementations
impl RefUnwindSafe for RequestUrl
impl Send for RequestUrl
impl Sync for RequestUrl
impl Unpin for RequestUrl
impl UnwindSafe for RequestUrl
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,