pub trait HttpClient:
Send
+ Sync
+ Debug {
// Required method
fn execute_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<BufResponse, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
An HTTP client which can send requests.
Required Methods§
Sourcefn execute_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<BufResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn execute_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<BufResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a request to the service.
It does not consume the request. Implementors are expected to clone the necessary parts of the request and pass them to the underlying transport.
§Errors
The built-in RetryPolicy will resend the Request
for some ErrorKind::HttpResponse status codes e.g., StatusCode::TooManyRequests and
for ErrorKind::Io returned by your HttpClient for situations like connection resets.