pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new() -> Self
Sourcepub fn base_url(self, base_url: &str) -> Self
pub fn base_url(self, base_url: &str) -> Self
Set a base_url so you can pass relative paths instead of full URLs.
pub fn with_middleware<T: Middleware + 'static>(self, middleware: T) -> Self
pub fn middleware<T: Middleware + 'static>(self, middleware: T) -> Self
Sourcepub fn with_tls_connector(
self,
connector: HttpsConnector<HttpConnector>,
) -> Self
pub fn with_tls_connector( self, connector: HttpsConnector<HttpConnector>, ) -> Self
Set a custom TLS connector to use for making requests.
pub fn no_default_headers(self) -> Self
pub fn default_headers<S: AsRef<str>, I: Iterator<Item = (S, S)>>( self, headers: I, ) -> Self
pub fn default_header<S: AsRef<str>>(self, key: S, value: S) -> Self
pub fn get(&self, url_or_path: impl AsRef<str>) -> RequestBuilder<'_, Client>
pub fn post(&self, uri_or_path: impl AsRef<str>) -> RequestBuilder<'_, Client>
pub fn delete(&self, uri_or_path: impl AsRef<str>) -> RequestBuilder<'_>
pub fn put(&self, uri_or_path: impl AsRef<str>) -> RequestBuilder<'_>
pub fn patch(&self, uri_or_path: impl AsRef<str>) -> RequestBuilder<'_>
pub fn request( &self, method: Method, uri_or_path: impl AsRef<str>, ) -> RequestBuilder<'_>
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