reqwest-middleware
reqwest-middleware copied to clipboard
Middleware wrappers for reqwest::Response
There is currently no wrapper for reqwest::Response. As a result, resp.body().await? call is not retried. In the case where the response is large, resp.body() call involves a lot of tcp socket listening and can potentially throw network errors
From what I understand about this issue, you want to be able to retry the response body? As far as I'm aware, it's not possible to do so without making a full new request again.
This would require the Response to carry around the Client
and Request
structs with it. I'm not sure if I like that being a default behaviour.
Perhaps I could interest you in https://docs.rs/futures-retry-policies/0.2.2/futures_retry_policies/ instead? It's a library I made using the same RetryPolicy types in order to retry arbitrary async functions