Struct ureq::RequestUrl[][src]

pub struct RequestUrl { /* fields omitted */ }

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]

impl Debug for RequestUrl[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.