Faraday: Adapter's extra options within assignment default_adapter

Created on 12 Nov 2019  ·  3Comments  ·  Source: lostisland/faraday

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.

feature help wanted

Most helpful comment

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

All 3 comments

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?

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olleolleolle picture olleolleolle  ·  5Comments

jordansissel picture jordansissel  ·  5Comments

ryanbyon picture ryanbyon  ·  3Comments

JasonBarnabe picture JasonBarnabe  ·  4Comments

jedeleh picture jedeleh  ·  3Comments