Expand description
HTTP client with retry, caching, and rate limiting.
All requests are queued and driven by tick(). Results arrive as
HttpEvent values polled from drain_events(). Each request runs on a
short-lived background thread using ureq
(rustls for HTTPS, no OpenSSL), so tick() never blocks the frame.
The network backend needs the http cargo feature. Without it every
request fails at once with HttpError::InvalidRequest saying so; before
0.3.0 every request was instead answered with a made-up empty 200 OK.
§Features
- GET, POST, PUT, DELETE, PATCH
- Per-request timeout
- Retry with exponential backoff and jitter
- In-memory response cache (ETag / Last-Modified)
- Rate limiter (token bucket per base URL)
- JSON body helpers
- Binary response support
Structs§
- Http
Client - Non-blocking HTTP client driven by
tick(). - Http
Request - An HTTP request to be issued by the client.
- Http
Response - A response from the server (or from the cache).
- Rate
Limiter - Token-bucket rate limiter per base URL.
- Request
Id - Identifies one request across its retries and events.
Enums§
- Cache
Policy - How a GET request uses the response cache.
- Http
Error - Why a request failed.
- Http
Event - Something that happened to a request, from
HttpClient::drain_events. - Method
- HTTP request method.