Trait inth_oauth2_async::client::http_client::HttpClient[][src]

pub trait HttpClient {
    fn post<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        client_id: &'life2 str,
        client_secret: &'life3 str,
        body: String
    ) -> Pin<Box<dyn Future<Output = Result<Value, ClientError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
; }
Expand description

Abstraction of the parts of a HTTP client implementation that this crate needs.

Required methods

Make a HTTP POST request.

[client_id] and [client_secret] are to be given as HTTP Basic Auth credentials username and password, respectively.

The [body] is of content-type application/x-www-form-urlencoded, and the response body is expected to be application/json.

The response body must be deserialized into a json value.

Implementations on Foreign Types

Implementors