Skip to content
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

Change certain settings per request #1544

Open
rudolphfroger-ds opened this issue May 15, 2022 · 2 comments
Open

Change certain settings per request #1544

rudolphfroger-ds opened this issue May 15, 2022 · 2 comments

Comments

@rudolphfroger-ds
Copy link

It would be nice to change certain things per request which are currently set on the Client. For some settings the Client acts as a way to set default settings. My use case would be setting a different client certificate depending on the hostname. One can work around this by using multiple Clients but it would be nice to keep the connection pooling and other advantages of sharing a Client between requests. Setting default_headers already works this way.

I'm not sure if this is worth the trouble. Maybe reqwest users should just keep a Client per hostname (for example) if they want different connection settings per hostname.

Also see #353.

@seanmonstar
Copy link
Owner

In general terms, it's probably a good idea to allow request options to override client options. I think timeout already works that way... it'd probably be better to come up with a system that applies all options, instead of one-off each option...

@seanmonstar
Copy link
Owner

But also, some settings fundamentally can't be changed per request, since the are options on shared types like the connector or pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants