attohttpc

Rust lightweight HTTP 1.1 client

Latest version: 0.29.2 registry icon
Maintenance score
81
Safety score
100
Popularity score
76
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.29.2 0 0 0 0 0
0.29.1 0 0 0 0 0
0.29.0 0 0 0 0 0
0.28.5 0 0 0 0 0
0.28.4 0 0 0 0 0
0.28.3 0 0 0 0 0
0.28.2 0 0 0 0 0
0.28.1 0 0 0 0 0
0.28.0 0 0 0 0 0
0.27.0 0 0 0 0 0
0.26.1 0 0 0 0 0
0.26.0 0 0 0 0 0
0.25.0 0 0 0 0 0
0.24.1 0 0 0 0 0
0.24.0 0 0 0 0 0
0.23.1 0 0 0 0 0
0.23.0 0 0 0 0 0
0.22.0 0 0 0 0 0
0.21.0 0 0 0 0 0
0.20.0 0 0 0 0 0
0.19.1 0 0 0 0 0
0.19.0 0 0 0 0 0
0.18.0 0 0 0 0 0
0.17.0 0 0 0 0 0
0.16.3 0 0 0 0 0
0.16.2 0 0 0 0 0
0.16.1 0 0 0 0 0
0.16.0 0 0 0 0 0
0.15.0 0 0 0 0 0
0.14.0 0 0 0 0 0
0.13.0 0 0 0 0 0
0.12.0 0 0 0 0 0
0.11.1 0 0 0 0 0
0.11.0 0 0 0 0 0
0.10.1 0 0 0 0 0
0.10.0 0 0 0 0 0
0.9.0 0 0 0 0 0
0.8.0 0 0 0 0 0
0.7.0 0 0 0 0 0
0.6.0 0 0 0 0 0
0.5.2 0 0 0 0 0
0.5.1 0 0 0 0 0
0.5.0 0 0 0 0 0
0.4.5 0 0 0 0 0
0.4.4 0 0 0 0 0
0.4.1 0 0 0 0 0
0.4.0 0 0 0 0 0
0.3.0 0 0 0 0 0

Stability
Latest release:

0.29.2 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

MPL-2.0   -   Mozilla Public License 2.0

Not a wildcard

Not proprietary

OSI Compliant



attohttpc

Documentation | Crates.io | Repository

Why attohttpc?

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:

  • Lightweight
  • Secure
  • Easy to use
  • Modular
  • HTTP/1.1
  • Use quality crates from the ecosystem (http, url, encoding_rs), not reinventing the wheel.

Features

  • charsets support for decoding more text encodings than just UTF-8
  • compress support for decompressing response bodies using miniz_oxide (default)
  • compress-zlib support for decompressing response bodies using zlib instead of miniz_oxide (see flate2 backends)
  • compress-zlib-ng support for decompressing response bodies using zlib-ng instead of miniz_oxide (see flate2 backends)
  • json support for serialization and deserialization
  • form support for url encoded forms (does not include support for multipart)
  • multipart-form support for multipart forms (does not include support for url encoding)
  • tls-native support for tls connections using the native-tls crate (default)
  • tls-native-vendored activate the vendored feature of native-tls
  • tls-rustls-webpki-roots support for TLS connections using rustls instead of native-tls with Web PKI roots
  • tls-rustls-native-roots support for TLS connections using rustls with root certificates loaded from the rustls-native-certs crate

Usage

See the examples/ folder in the repository for more use cases.

let resp = attohttpc::post("https://my-api.com/do/something").json(&request)?.send()?;
if resp.is_success() {
    let response = resp.json()?;
    // ...
}

Current feature set

  • Query parameters, Request headers, Bodies, etc.
  • TLS, adding trusted certificates, disabling verification, etc. for both native-tls and rustls
  • Automatic redirection
  • Streaming response body
  • Multiple text encodings
  • Automatic compression/decompression with gzip or deflate
  • Transfer-Encoding: chunked
  • serde/json support
  • HTTP Proxies & HTTP_PROXY, HTTPS_PROXY, NO_PROXY environment variables.
  • Happy Eyeballs
  • Authentication (partial support)

License

This project is licensed under the MPL-2.0.