Struct ureq::RequestUrl
source · 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)