reqx
HTTP transport for Rust API SDKs. reqx provides consistent retry, timeout,
idempotency, proxy, TLS, streaming, and observability behavior across async and
blocking clients.
Features
- Idempotency-aware retries with
Retry-After, retry budgets, and circuit breakers - Per-attempt, response-body, connect, and total timeouts
- Async and blocking clients with buffered and streaming I/O
- Rate limiting, concurrency limits, and multi-endpoint routing
- Rustls or native-tls, including custom CAs and mTLS
- Proxies, redirects, response size limits, and structured errors
- Metrics, observers, interceptors, and optional OpenTelemetry integration
Installation
The default build uses the async client with rustls (ring) and enables gzip
response decoding:
To replace the default transport or TLS backend:
| Feature | Transport |
|---|---|
async-tls-rustls-ring |
Async, rustls with ring (default) |
async-tls-rustls-aws-lc-rs |
Async, rustls with AWS-LC |
async-tls-native |
Async, platform-native TLS |
blocking-tls-rustls-ring |
Blocking (ureq), rustls with ring |
blocking-tls-rustls-aws-lc-rs |
Blocking (ureq), rustls with AWS-LC |
blocking-tls-native |
Blocking (ureq), platform-native TLS |
TLS backend features are additive. When several are enabled, select one with
Client::builder(...).tls_backend(...); rustls with ring is preferred by
default. Optional capabilities include all-codec compression, individual
compression-* codecs, resumable-upload, and otel; enable otel before
calling .otel_enabled(true).
Quick start
use Duration;
use Client;
async
POST requests are retried only when they can be sent safely; provide an
idempotency key when the API supports one.
Documentation
Run the async example with cargo run --example basic_json. For the blocking
client, run: