pub struct Client { /* private fields */ }Expand description
An asynchronous Client to make Requests with.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Creates a ClientBuilder to configure a Client.
This is the same as ClientBuilder::new().
Sourcepub async fn execute(&self, request: Request) -> Result<Response>
pub async fn execute(&self, request: Request) -> Result<Response>
Send a request and wait for a response.
Available on crate feature cookies only.
cookies only.Get stored cookie value for specified URL. If the URL is valid while no
value found, it returns Ok(None).
Sourcepub fn request<U: IntoUrl>(
&self,
method: Method,
url: U,
) -> Result<RequestBuilder>
pub fn request<U: IntoUrl>( &self, method: Method, url: U, ) -> Result<RequestBuilder>
Send a request with method and url.
Sourcepub fn get<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
pub fn get<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
Convenience method to make a GET request to a URL.
Sourcepub fn post<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
pub fn post<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
Convenience method to make a POST request to a URL.
Sourcepub fn put<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
pub fn put<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
Convenience method to make a PUT request to a URL.
Sourcepub fn patch<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
pub fn patch<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
Convenience method to make a PATCH request to a URL.
Sourcepub fn delete<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
pub fn delete<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
Convenience method to make a DELETE request to a URL.
Sourcepub fn head<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
pub fn head<U: IntoUrl>(&self, url: U) -> Result<RequestBuilder>
Convenience method to make a HEAD request to a URL.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more