reqwest-retry-after
is a library that adds support for the Retry-After
header in reqwest, using reqwest_middleware.
Pass RetryAfterMiddleware
to the ClientWithMiddleware
builder.
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};
use reqwest_retry_after::RetryAfterMiddleware;
let client = ClientBuilder::new(reqwest::Client::new())
.with(RetryAfterMiddleware::new())
.build();