Crates.io | reqwest-partial-retry |
lib.rs | reqwest-partial-retry |
version | 0.1.1 |
source | src |
created_at | 2023-11-06 00:53:28.848806 |
updated_at | 2023-11-11 22:48:51.612299 |
description | Wrapper around reqwest to allow for easy partial retries |
homepage | |
repository | https://github.com/Funami580/reqwest-partial-retry |
max_upload_size | |
id | 1026249 |
size | 37,127 |
Wrapper around reqwest to allow for easy partial retries
use futures_util::StreamExt;
use reqwest_partial_retry::ClientExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new().resumable();
let request = client.get("http://httpbin.org/ip").build().unwrap();
let mut stream = client
.execute_resumable(request)
.await?
.bytes_stream_resumable();
while let Some(item) = stream.next().await {
println!("Bytes: {:?}", item?);
}
Ok(())
}