pub struct RequestUrl { /* private fields */ }
Expand description
Parsed result of a request url with handy inspection methods.
Implementations§
Source§impl RequestUrl
impl RequestUrl
Sourcepub fn port(&self) -> Option<u16>
pub fn port(&self) -> Option<u16>
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
.
Sourcepub fn query_pairs(&self) -> Vec<(&str, &str)>
pub fn query_pairs(&self) -> Vec<(&str, &str)>
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§
Source§impl Clone for RequestUrl
impl Clone for RequestUrl
Source§fn clone(&self) -> RequestUrl
fn clone(&self) -> RequestUrl
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for RequestUrl
impl RefUnwindSafe for RequestUrl
impl Send for RequestUrl
impl Sync for RequestUrl
impl Unpin for RequestUrl
impl UnwindSafe for RequestUrl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more