Skip to main content

HttpSender

Trait HttpSender 

Source
pub trait HttpSender:
    Send
    + Sync
    + Debug {
    // Required method
    fn send<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        method: &'life1 str,
        url: &'life2 str,
        headers: &'life3 HashMap<String, String>,
        body: Value,
    ) -> Pin<Box<dyn Future<Output = Result<u16>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Trait for sending HTTP requests (abstracts reqwest for testability)

Required Methods§

Source

fn send<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, method: &'life1 str, url: &'life2 str, headers: &'life3 HashMap<String, String>, body: Value, ) -> Pin<Box<dyn Future<Output = Result<u16>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Send an HTTP request and return the status code

Implementors§