pub trait RestClient: Send + Sync {
// Required methods
fn get_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn post_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn get_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Makes a GET request and logs on DEBUG.
§Arguments
url: the URL on which GET will be calledheaders: optional headers that will be set on the request
Sourcefn post_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Makes a POST request, and logs on DEBUG.
§Arguments
url: the URL on which POST will be calledheaders: the optional POST headersbody: the optional POST body
Sourcefn delete_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_request<'life0, 'async_trait>(
&'life0 self,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RestResponse, ServiceConnectivityError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Makes a DELETE request, and logs on DEBUG.
§Arguments
url: the URL on which DELETE will be calledheaders: the optional DELETE headersbody: the optional DELETE body