-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Allow running a request with changed configuration #821
Comments
Hi @ConradIrwin and welcome to ureq! Interesting problem and it is an oversight, the per-request config is quite new. Maybe we can do something like: impl Agent {
pub fn configure_request(&self, request: Request<impl AsSendBody>) -> &mut AgentConfig { ... }
} |
The name |
That'd be great! I am currently building on Ureq 2.x, and just maintaining a pool of agents depending on the timeout (because in reality the connection pool is only helpful when connecting to the same host, and my timeouts are per host). How "ready" is the 3 branch? If you're at the point you want some production testing, I'd be happy to upgrade now; but if you think we need to wait a bit, I can do that :D. |
My plan is to release the 3.0.0-rc1 ASAP. It's mostly held back by that I think I need to write some migration doc. I'm using the main branch in production at work, but it would be great to get feedback on how it works for others too. |
I'm looking into Ureq as a replacement for isahc, and one thing we're missing is a nice way to set per-request read timeouts.
I see that in 3.x timeouts can be overridden per request, but only if we go through the
Ureq
builder. We can do this, but it'd be nice to preserve the current API where we get passed anhttp::Request<X>
and we pass it on down. I tried to create some helper functions where we matched on the method, and called the appropriate builder function; but it looks like theWithBody
/WithoutBody
types are not exposed, so I can't easily do that.As you make progress on the v3, it'd be nice to have something like:
The text was updated successfully, but these errors were encountered: