HttpProvider

Trait HttpProvider 

Source
pub trait HttpProvider: Send + Sync {
    // Required methods
    fn request(
        &self,
        method: &str,
        url: &str,
        headers: HashMap<String, String>,
        body: Option<Vec<u8>>,
    ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + '_>>;
    fn is_mock(&self) -> bool;
}
Expand description

Provider trait for HTTP operations.

Required Methods§

Source

fn request( &self, method: &str, url: &str, headers: HashMap<String, String>, body: Option<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + '_>>

Make an HTTP request.

Source

fn is_mock(&self) -> bool

Check if this is a mock provider.

Implementors§