careerbuilder / ruby-cb-api

Ruby wrapper around the CareerBuilder.com APIs
Apache License 2.0
14 stars 18 forks source link

Allow optional Accept header #285

Closed tkling closed 6 years ago

tkling commented 7 years ago

This PR adds an optional parameter to the Cb::Clients::Base.headers method to allow overriding of the Accept header.

It still defaults to the old value (application/json), but now if you pass in the kwarg :accept_header the headers that are returned will contain the value of the kwarg for the Accept header. The base client didn't have any tests so I did a quick, cheesy test for the cb_client method and then some more in depth tests that assert how the headers method works.

Casao commented 6 years ago

What's the scenario where we need to change this but none of the other headers?