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

Get access to inner client from ClientWithMiddleware? #203

Open
milesj opened this issue Nov 29, 2024 · 1 comment
Open

Get access to inner client from ClientWithMiddleware? #203

milesj opened this issue Nov 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@milesj
Copy link

milesj commented Nov 29, 2024

Motivations

I'm using some functions from outside of our project that require &reqwest::Client as an argument, but we're using middleware via ClientWithMiddleware, and there's no way to access the inner reqwest::Client to pass to this function.

For these functions/situations, we do not care about running the middleware, just that we are reusing the same client.

Solution

Maybe a ClientWithMiddleware.get_inner() method, or implement AsRef<Client> for ClientWithMiddleware.

Alternatives

Additional context

@miguelhrocha
Copy link

I went ahead and implemented this: #209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants