pub struct Client { /* private fields */ }Expand description
Implementations§
Source§impl Client
impl Client
Sourcepub fn with_default_headers(headers: Vec<(String, String)>) -> Self
pub fn with_default_headers(headers: Vec<(String, String)>) -> Self
Creates a client with default headers that will be sent with every request.
Sourcepub fn default_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn default_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Adds a default header that will be sent with every request.
Sourcepub fn get(&self, url: impl Into<String>) -> RequestBuilder
pub fn get(&self, url: impl Into<String>) -> RequestBuilder
Creates a GET request.
Sourcepub fn post(&self, url: impl Into<String>) -> RequestBuilder
pub fn post(&self, url: impl Into<String>) -> RequestBuilder
Creates a POST request.
Sourcepub fn put(&self, url: impl Into<String>) -> RequestBuilder
pub fn put(&self, url: impl Into<String>) -> RequestBuilder
Creates a PUT request.
Sourcepub fn delete(&self, url: impl Into<String>) -> RequestBuilder
pub fn delete(&self, url: impl Into<String>) -> RequestBuilder
Creates a DELETE request.
Sourcepub fn patch(&self, url: impl Into<String>) -> RequestBuilder
pub fn patch(&self, url: impl Into<String>) -> RequestBuilder
Creates a PATCH request.
Sourcepub fn head(&self, url: impl Into<String>) -> RequestBuilder
pub fn head(&self, url: impl Into<String>) -> RequestBuilder
Creates a HEAD request.
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 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