reqwest-middleware
A crate implementing a wrapper around reqwest to allow for client middleware chains.
This crate provides functionality for building and running middleware but no middleware implementations. This repository also contains a couple of useful concrete middleware crates:
reqwest-retry
: retry failed requests.reqwest-tracing
:tracing
integration, optional opentelemetry support.
Overview
The reqwest-middleware
client exposes the same interface as a plain reqwest
client, but
ClientBuilder
exposes functionality to attach middleware:
# Cargo.toml
# ...
[]
= "0.11"
= "0.1.6"
= "0.1.5"
= "0.2.3"
= { = "1.12.0", = ["macros", "rt-multi-thread"] }
use ;
use ;
use TracingMiddleware;
async
async
License
Third-party middleware
The following third-party middleware use request-middleware
:
reqwest-conditional-middleware
- Per-request basis middlewarehttp-cache
- HTTP caching rulesreqwest-cache
- HTTP cachingaliri_reqwest
- Background token management and renewalhttp-signature-normalization-reqwest
(not free software) - HTTP Signatures