$ reqwest-middleware
v0.5.2Wrapper around reqwest to allow for client middleware chains.
Latest Update Summary
Crate
Name: reqwest-middleware New version: 0.5.0 Release date: 2026-01-07T23:58:59.440250Z
Crate readme
Short description A crate implementing a wrapper around reqwest to allow for client middleware chains.
Long description This crate provides functionality for building and running middleware but no middleware implementations. The reqwest-middleware client exposes the same interface as a plain reqwest client, allowing the attachment of middleware.
Features • reqwest-retry: retry failed requests • reqwest-tracing: tracing integration with optional opentelemetry support • tokio support with macros and multi-threaded runtime
Code Examples Add to Cargo.toml
[dependencies]
reqwest = "0.13"
reqwest-middleware = "0.5"
reqwest-retry = "0.9"
reqwest-tracing = "0.6"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
Basic usage
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};
use reqwest_retry::{RetryTransientMiddleware, policies::ExponentialBackoff};
use reqwest_tracing::TracingMiddleware;
#[tokio::main]
async fn main() {
let retry_policy = ExponentialBackoff::builder().build_with_max_retries(3);
let client = ClientBuilder::new(reqwest::Client::new())
.with(TracingMiddleware::default())
.with(RetryTransientMiddleware::new_with_policy(retry_policy))
.build();
run(client).await;
}
async fn run(client: ClientWithMiddleware) {
client
.get("https://truelayer.com")
.header("foo", "bar")
.send()
.await
.unwrap();
}
Links • https://crates.io/crates/reqwest • https://crates.io/crates/reqwest-retry • https://crates.io/crates/reqwest-tracing • https://github.com/TrueLayer/reqwest-middleware/pull/105 • https://github.com/oxidecomputer/reqwest-conditional-middleware • https://github.com/06chaynes/http-cache • https://gitlab.com/famedly/company/backend/libraries/reqwest-cache • https://github.com/neoeinstein/aliri/tree/main/aliri_reqwest • https://crates.io/crates/http-signature-normalization-reqwest • https://github.com/tommilligan/reqwest-chain
https://api.github.com/repos/TrueLayer/reqwest-middleware/releases/274995236
Release info
Release version:
Release description
Code Examples
Patch update: 0.5.1 → 0.5.2
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add reqwest-middlewareOr add to Cargo.toml: reqwest-middleware = "0.5.2"