HttpClient

Trait HttpClient 

Source
pub trait HttpClient: Debug {
    // Required methods
    fn request_builder(&self, method: Method, url: Url) -> RequestBuilder;
    fn send<'life0, 'async_trait>(
        &'life0 self,
        req: RequestBuilder,
    ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Abstracts the implementation used for actual requests.

This is used for testing purposes such that we don’t need to run an actual server instance but instead directly call into the axum router

Required Methods§

Source

fn request_builder(&self, method: Method, url: Url) -> RequestBuilder

Source

fn send<'life0, 'async_trait>( &'life0 self, req: RequestBuilder, ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§