Skip to main content

HttpClient

Trait HttpClient 

Source
pub trait HttpClient {
    // Required method
    fn get(&self, url: &str) -> Result<Vec<u8>, HttpError>;
}
Expand description

Minimal blocking HTTP GET, abstracted so sync logic is tested with a mock.

Required Methods§

Source

fn get(&self, url: &str) -> Result<Vec<u8>, HttpError>

GET url, returning the response body on a 2xx status.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§