surf-retry

Crates.iosurf-retry
lib.rssurf-retry
version0.3.2
sourcesrc
created_at2022-06-01 22:32:10.388086
updated_at2023-10-07 00:45:54.359824
descriptionA retry middleware for surf
homepage
repositoryhttps://github.com/06chaynes/surf-retry.git
max_upload_size
id598544
size26,113
Christian Haynes (06chaynes)

documentation

README

surf-retry

A retry middleware for surf

Install

With cargo add installed :

cargo add surf-retry

Documentation

Example

use surf_retry::RetryMiddleware;
use surf::{Client, Request, http::Method};
use url::Url;

use std::time::Duration;

#[async_std::main]
async fn main() -> surf::Result<()> {
    let req = Request::new(Method::Get, Url::parse("https://example.api")?);
    let client = Client::new().with(RetryMiddleware::default());
    let res = client.send(req).await?;
    Ok(())
}
Commit count: 11

cargo fmt