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

Adapter's extra options within assignment default_adapter #1073

Closed
aleksb86 opened this issue Nov 12, 2019 · 3 comments · Fixed by #1382
Closed

Adapter's extra options within assignment default_adapter #1073

aleksb86 opened this issue Nov 12, 2019 · 3 comments · Fixed by #1382

Comments

@aleksb86
Copy link

Hi,

It's seems that missing support adapter extra options within assignment default_adapter. I want to assign default_adapter once (in initialization) and use it in a few connections. Because typhoeus adapter need some extra options (http_version: :httpv2_0), I should to add it in each connection, that produces some duplications. It would be great - to assign default_adapter and set its options in the same place.

@iMacTia
Copy link
Member

iMacTia commented Nov 12, 2019

Hi @aleksb86, thanks for opening this.

That sounds like a reasonable feature, you'd be looking at something like this:

Faraday.default_adapter = :typhoeus
Faraday.default_adapter_options = {...}

conn = Faraday.new(...)
# conn will use default adapter with default options

Would this work for you or did you have something different in mind?

@aleksb86
Copy link
Author

aleksb86 commented Nov 12, 2019

Thanks for fast reply. It is looking great, this is exactly what is missing.

@iMacTia
Copy link
Member

iMacTia commented Nov 12, 2019

Great, I've labelled it as a new feature so we'll pick it for development at some point.
Since this is not a critical part of the library, we're happy to review a contributor PR if anyone wants to work on it

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

Successfully merging a pull request may close this issue.

2 participants