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:tracingintegration, optional opentelemetry support.
Note about browser support: automated tests targeting wasm are disabled. The crate may work with wasm but wasm support is unmaintained. PRs improving wasm are still welcome but you'd need to reintroduce the tests and get them passing before we'd merge it (see https://github.com/TrueLayer/reqwest-middleware/pull/105).
Overview
The reqwest-middleware client exposes the same interface as a plain reqwest client, but
ClientBuilder exposes functionality to attach middleware:
# Cargo.toml
# ...
[]
= { = "0.13.1", = ["rustls"] }
= "0.5"
= "0.9"
= "0.6"
= { = "1.0", = ["macros", "rt-multi-thread"] }
use ;
use ;
use TracingMiddleware;
async
async