pub struct Client<TSigner> { /* private fields */ }
Expand description
Compatible interface with reqwest’s Client
.
Implementations§
Source§impl Client<()>
impl Client<()>
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new Client
.
This method calls reqwest::Client::new() internally.
Sourcepub fn new_with_client(client: ReqwestClient) -> Self
pub fn new_with_client(client: ReqwestClient) -> Self
Constructs a new Client
with specifying inner reqwest::Client
.
Source§impl<T> Client<T>where
T: Clone,
impl<T> Client<T>where
T: Clone,
Sourcepub fn get<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
pub fn get<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
Convenience method to make a GET
request to a URL.
§Errors
This method fails whenever supplied Url
cannot be parsed.
Sourcepub fn post<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
pub fn post<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
Convenience method to make a POST
request to a URL.
§Errors
This method fails whenever supplied Url
cannot be parsed.
Sourcepub fn put<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
pub fn put<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
Convenience method to make a PUT
request to a URL.
§Errors
This method fails whenever supplied Url
cannot be parsed.
Sourcepub fn patch<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
pub fn patch<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
Convenience method to make a PATCH
request to a URL.
§Errors
This method fails whenever supplied Url
cannot be parsed.
Sourcepub fn delete<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
pub fn delete<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
Convenience method to make a DELETE
request to a URL.
§Errors
This method fails whenever supplied Url
cannot be parsed.
Sourcepub fn head<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
pub fn head<U: IntoUrl + Clone>(&self, url: U) -> RequestBuilder<T>
Convenience method to make a HEAD
request to a URL.
§Errors
This method fails whenever supplied Url
cannot be parsed.
Sourcepub fn request<U: IntoUrl + Clone>(
&self,
method: Method,
url: U,
) -> RequestBuilder<T>
pub fn request<U: IntoUrl + Clone>( &self, method: Method, url: U, ) -> RequestBuilder<T>
Start building a Request
with the Method
and Url
.
Returns a RequestBuilder<T>
, which will allow setting headers and
request body before sending.
§Errors
This method fails whenever supplied Url
cannot be parsed.