| Crates.io | reessaie |
| lib.rs | reessaie |
| version | 3.0.0 |
| created_at | 2025-10-10 05:10:46.446097+00 |
| updated_at | 2025-11-29 03:48:00.437571+00 |
| description | Companion to reqwest_retry to use the Retry-After HTTP header if available |
| homepage | https://github.com/clechasseur/reessaie#readme |
| repository | https://github.com/clechasseur/reessaie |
| max_upload_size | |
| id | 1876531 |
| size | 90,393 |
reessaieCompanion library to reqwest-retry with helpers to use the Retry-After HTTP header to control the time between retries, if it's available.
Partially inspired by reqwest-retry-after.
Add reessaie to your dependencies:
[dependencies]
reessaie = "3.0.0"
or by running:
cargo add reesaie
use anyhow::Context;
use reessaie::{RetryAfterMiddleware, RetryAfterPolicy};
use reqwest::Client;
use reqwest_middleware::ClientBuilder;
async fn get_with_retries(url: &str, max_retries: u32) -> Result<String, anyhow::Error> {
let policy = RetryAfterPolicy::with_max_retries(max_retries);
let client = ClientBuilder::new(Client::new())
.with(RetryAfterMiddleware::new_with_policy(policy))
.build();
Ok(client
.get(url)
.send()
.await
.with_context(|| format!("error getting {url}"))?
.text()
.await
.with_context(|| format!("error getting text for {url}"))?)
}
For more information, see the docs.
reessaie currently builds on Rust 1.88 or newer.