Skip to content

06chaynes/surf-retry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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(())
}

About

A retry middleware for surf

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages