This crate provides traits for the reqwest crate. It is intended to be used by libraries that need to make HTTP requests, want to allow users to inject their own reqwest client, but don't want to force users to use reqwest::Client.
```rust use reqwest_traits::Client;
struct MyClient
async fn plainreqwest() { let http = reqwest::Client::new(); let client = MyClient { http }; let req = client.http.get("https://example.com"); let response = req.send().await.unwrap(); asserteq!(response.status(), 200); }
async fn reqwestmiddleware() { let http = reqwestmiddleware::ClientBuilder::new( reqwest::Client::new(), ).build(); let client = MyClient { http }; let req = client.http.get("https://example.com"); let response = req.send().await.unwrap(); assert_eq!(response.status(), 200); } ```
License: MIT