Struct ureq::RequestUrl

source ·
pub struct RequestUrl { /* private fields */ }
Expand description

Parsed result of a request url with handy inspection methods.

Implementations§

Handle the request url as a standard url::Url.

Get the scheme of the request url, i.e. “https” or “http”.

Host of the request url.

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.

Path of the request url.

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()?.query_pairs(), vec![
    ("foo", "42"),
    ("foo", "43")
]);

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.