reqwest
reqwest copied to clipboard
Propagate timeout from client to request early on
This allows not just setting, but also mutating the timeout via .timeout_mut()
.
For example:
let mut request = client.post(url).build()?;
// Increase timeout (without this PR, `timeout_mut()` always returns None)
*request.timeout_mut().get_or_insert(Duration::ZERO) += timeout;
let response = client.execute(request).await?;
I'm not sure if this is the right approach, but some way of increasing timeout would be very useful :)