HttpClient
httpclient
is a user-friendly http client in Rust. Where possible, it closely mimics the reqwest
API. Why build a
new http client?
httpclient
Request and
Response` objects are serde-serializable, which enables record/replay functionality. See the example below to see it in action.httpclient
provides an API for user-extensible middleware. Built-in middleware includes redirect, retry, logging, and record/replay.httpclient
provides a built-inError
type that can return the Http request, which includes the status code, headers, and response body.httpclient
provides convenience methods thatreqwest
does not support. The most important issend_awaiting_body
which awaits both the request and the response body, which greatly simplifies the scenario where you want to return the request body even in error cases.
Note:
httpclient
is under active development and is alpha quality software. While we make effort not to change public APIs, we do not currently provide stability guarantees.
Examples
async
Roadmap
- Hide secrets in Recorder. Hash & Eq checks for requests must respect hidden values.
- Ensure it builds on wasm32-unknown-unknown