13 lines
256 B
Rust
13 lines
256 B
Rust
pub struct HttpClient {}
|
|
|
|
impl HttpClient {
|
|
pub fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
pub async fn get(&self, url: &str) -> anyhow::Result<Vec<u8>> {
|
|
let bytes = reqwest::get(url).await?.bytes().await?;
|
|
Ok(bytes.into())
|
|
}
|
|
}
|