Skip to content

Conversation

@technoweenie
Copy link
Member

This implements Faraday::Connection#options almost as expected, fixing #305.

We can't rename the current :options attr_reader right now for backwards compatibility reasons. Instead, this overloads the method to support both use cases. Merging the two risks some clashing, but I can only think of one issue: the other request helpers like #get can be called with no arguments:

conn = Faraday.new 'http://example.com'
conn.get # GET /
conn.options # oops!

You can get around this easily with conn.options(nil). I think it's worth introducing this regardless of the risk, assuming we'll rip it out when v1.0 ships.

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addition - with documentation - extends the reach if the user, to include a new HTTP verb.

👍

@iMacTia
Copy link
Member

iMacTia commented Feb 20, 2019

Ignoring CodeClimate issues, not sure they actually make sense in this case

@iMacTia iMacTia merged commit 5cad588 into master Feb 20, 2019
@iMacTia iMacTia deleted the conn-options branch February 20, 2019 22:02
@technoweenie technoweenie mentioned this pull request Jun 25, 2019
3 tasks
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

Successfully merging this pull request may close these issues.

4 participants