fetch-kit
Resilient HTTP client for Rust — retry, circuit breaker, connection pooling, and typed JSON helpers built on reqwest.
Naming: previously
fetchkit; renamed tofetch-kit(estate convention) becausefetchkiton crates.io belongs to an unrelated project (maintained byeverruns). Published asfetch-kit.
Features
- Automatic retries with exponential backoff via
reqwest-retry - Typed JSON helpers —
get_json/post_jsondeserialize responses directly - Fallback fetching — try a primary URL, fall back to another on failure
- Circuit breaker (opt-in) — stop hammering a dead service
- Connection pooling — inherits reqwest's connection pool
- Pluggable middleware — built on
reqwest-middleware
Quick Start
use Client;
use Duration;
async
Circuit Breaker
Enable the circuit-breaker feature to wrap requests in a breaker that
automatically rejects calls after repeated failures.
use Client;
use ;
async
Request Builder
use Client;
use Duration;
async
Comparison with raw reqwest
| raw reqwest | fetch-kit | |
|---|---|---|
| Retries | manual or separate middleware | built-in (configurable) |
| JSON helpers | resp.json::<T>() each time |
get_json / post_json |
| Fallback | write it yourself | fetch_with_fallback |
| Timeout | per-client or per-request | builder default (30s) |
License
Licensed under either of MIT or Apache-2.0 at your option.