whichdigital / active-rest-client

ActiveRestClient API Client
https://rubygems.org/gems/active_rest_client
MIT License
385 stars 44 forks source link

Clarify what "complete" configuration block means #102

Closed chibicode closed 9 years ago

chibicode commented 9 years ago

This is a documentation update suggestion - I might be the only person dumb enough to run into this error, but it might actually be helpful to someone.

Motivation: I ran into the following error when I tried to change the faraday configuration option:

NoMethodError: undefined method `[]' for nil:NilClass
from /Users/shu/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/active_rest_client-1.0.9/lib/active_rest_client/request.rb:461:in `is_json_response?'

I assumed that calling faraday_config would overwrite the default options, so I thought it'd keep default options such as faraday.headers['Accept'] = "application/json". But it turned out that it replaces the default options. It took me forever to realize this because the error was on this line, which didn't seem to have much to do with the config. I updated the README so that hopefully people won't run into the same issue.

andyjeffries commented 9 years ago

LOL! Thanks @chibicode merged :+1: