Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

http-client

A minimal, backend-agnostic HTTP client abstraction used across the workspace (e.g. by download-manager) so callers depend on a small HttpClient trait instead of a specific HTTP library.

  • HttpClient — trait for sending an http::Request<Vec<u8>> and getting back an http::Response with an async, streamable body (Body).
  • MockClient — an in-memory implementation for tests.
  • ReqwestClient (feature reqwest, enabled by default) — a real backend built on reqwest.
use http_client::{HttpClient, ReqwestClient};
use http::Request;

let client = ReqwestClient::new()?;
let request = Request::get("https://example.com").body(Vec::new())?;
let response = client.send(request).await?;
# Ok::<(), Box<dyn std::error::Error + Send + Sync>>(())

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages