Documentation | Crates.io | Repository
This project's goal is to provide a lightweight and simple HTTP client for the Rust ecosystem. The intended use is for projects that have HTTP needs where performance is not critical or when HTTP is not the main purpose of the application. Note that the project still tries to perform well and avoid allocation where possible, but stays away from Rust's asynchronous stack to provide a crate that's as small as possible. Features are provided behind feature flags when possible to allow users to get just what they need. Here are the goals of the project:
http
, url
, encoding_rs
), not reinventing the wheel.charsets
support for decoding more text encodings than just UTF-8compress
support for decompressing response bodies (default)json
support for serialization and deserializationtls
support for tls connections (default)See the examples/
folder in the repository for more use cases.
rust
let (status, headers, body) = attohttpc::post("https://my-api.com/do/something").json(&request)?.send()?;
if status.is_success() {
let response = body.json()?;
// ...
}
serde
support behind a feature flagThis project is licensed under the MPL-2.0
.