pub trait Requester: Debug + Send + Sync {
fn get<'life0, 'async_trait>(
&'life0 self,
url: Url
) -> Pin<Box<dyn Future<Output = Result<Response, ()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn request_json<'life0, 'async_trait>(
&'life0 self,
method: Method,
url: Url,
data: Vec<u8>,
headers: Headers
) -> Pin<Box<dyn Future<Output = Result<Response, ()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
A description of a component used to perform an HTTP request.
Required Methods
Perform an GET request toward the needed resource.
Arguments
url
- the URL path to perform the HTTP GET on.
Perform a JSON request toward the needed resource.
Arguments
method
- the HTTP method.url
- the URL path to perform the request.data
- the body content to send.headers
- the headers to send.