Skip to main content

SimpleHttpClient

Trait SimpleHttpClient 

Source
pub trait SimpleHttpClient: Send + Sync {
    // Required method
    fn get_text<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<(StatusCode, Bytes), SpiderError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A simple HTTP client trait for fetching web content.

Required Methods§

Source

fn get_text<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<(StatusCode, Bytes), SpiderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetches the content of a URL as text.

Implementations on Foreign Types§

Source§

impl SimpleHttpClient for Client

Source§

fn get_text<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<(StatusCode, Bytes), SpiderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§