Skip to main content

HttpClient

Trait HttpClient 

Source
pub trait HttpClient: Send + Sync {
    // Required method
    fn get_text<'a>(
        &'a self,
        url: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<String, HttpError>> + Send + 'a>>;

    // Provided method
    fn get_bytes<'a>(
        &'a self,
        url: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, HttpError>> + Send + 'a>> { ... }
}
Expand description

Re-export framework services (HTTP, URI, etc.) from the dedicated services crate.

Required Methods§

Source

fn get_text<'a>( &'a self, url: &'a str, ) -> Pin<Box<dyn Future<Output = Result<String, HttpError>> + Send + 'a>>

Provided Methods§

Source

fn get_bytes<'a>( &'a self, url: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, HttpError>> + Send + 'a>>

Implementors§