pub trait HttpClient: Send + Sync {
// Required methods
fn get_value<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn post_form_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(String, String)],
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn post_json_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: &'life2 Value,
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
}Expand description
HTTP client trait for abstraction over different implementations
This trait uses serde_json::Value to maintain object safety
Required Methods§
Sourcefn get_value<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_value<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform a GET request and return JSON value
Sourcefn post_form_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(String, String)],
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn post_form_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(String, String)],
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Perform a POST request with form data and return JSON value
Sourcefn post_json_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: &'life2 Value,
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn post_json_value<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: &'life2 Value,
auth_header: Option<(&'life3 str, &'life4 str)>,
) -> Pin<Box<dyn Future<Output = Result<Value, HttpClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Perform a POST request with JSON body and return JSON value
Implementors§
impl HttpClient for ReqwestHttpClientWithAdminSupport
Available on non-WebAssembly and crate feature
http-reqwest only.impl HttpClient for ReqwestHttpClient
Available on non-WebAssembly and crate feature
http-reqwest only.