pub struct ReqwestHttpClient(pub ReqwestClient);Expand description
Thin wrapper around ReqwestClient so shared HTTP behavior lives in one place.
Token requests should not follow redirects, matching OAuth 2.0 guidance that token
endpoints return results directly instead of delegating to another URI. Configure
any custom ReqwestClient to disable redirect following, because the broker
passes this client into the oauth2 crate when it builds the facade layer.
Tuple Fields§
§0: ReqwestClientImplementations§
Source§impl ReqwestHttpClient
impl ReqwestHttpClient
Sourcepub fn with_client(client: ReqwestClient) -> Self
pub fn with_client(client: ReqwestClient) -> Self
Wraps an existing reqwest ReqwestClient.
Methods from Deref<Target = ReqwestClient>§
Sourcepub fn get<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn get<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a GET request to a URL.
§Errors
This method fails whenever the supplied Url cannot be parsed.
Sourcepub fn post<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn post<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a POST request to a URL.
§Errors
This method fails whenever the supplied Url cannot be parsed.
Sourcepub fn put<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn put<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a PUT request to a URL.
§Errors
This method fails whenever the supplied Url cannot be parsed.
Sourcepub fn patch<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn patch<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a PATCH request to a URL.
§Errors
This method fails whenever the supplied Url cannot be parsed.
Sourcepub fn delete<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn delete<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a DELETE request to a URL.
§Errors
This method fails whenever the supplied Url cannot be parsed.
Sourcepub fn head<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn head<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
Convenience method to make a HEAD request to a URL.
§Errors
This method fails whenever the supplied Url cannot be parsed.
Sourcepub fn request<U>(&self, method: Method, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn request<U>(&self, method: Method, url: U) -> RequestBuilderwhere
U: IntoUrl,
Start building a Request with the Method and Url.
Returns a RequestBuilder, which will allow setting headers and
the request body before sending.
§Errors
This method fails whenever the supplied Url cannot be parsed.
Sourcepub fn execute(
&self,
request: Request,
) -> impl Future<Output = Result<Response, Error>>
pub fn execute( &self, request: Request, ) -> impl Future<Output = Result<Response, Error>>
Executes a Request.
A Request can be built manually with Request::new() or obtained
from a RequestBuilder with RequestBuilder::build().
You should prefer to use the RequestBuilder and
RequestBuilder::send().
§Errors
This method fails if there was an error while sending request, redirect loop was detected or redirect limit was exhausted.
Trait Implementations§
Source§impl AsRef<Client> for ReqwestHttpClient
Available on crate feature reqwest only.
impl AsRef<Client> for ReqwestHttpClient
reqwest only.Source§fn as_ref(&self) -> &ReqwestClient
fn as_ref(&self) -> &ReqwestClient
Source§impl Clone for ReqwestHttpClient
impl Clone for ReqwestHttpClient
Source§fn clone(&self) -> ReqwestHttpClient
fn clone(&self) -> ReqwestHttpClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ReqwestHttpClient
impl Default for ReqwestHttpClient
Source§fn default() -> ReqwestHttpClient
fn default() -> ReqwestHttpClient
Source§impl Deref for ReqwestHttpClient
Available on crate feature reqwest only.
impl Deref for ReqwestHttpClient
reqwest only.Source§impl TokenHttpClient for ReqwestHttpClient
Available on crate feature reqwest only.
impl TokenHttpClient for ReqwestHttpClient
reqwest only.