-
Notifications
You must be signed in to change notification settings - Fork 65
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
Allow sending arbitrary headers for requests #113
Allow sending arbitrary headers for requests #113
Conversation
- Allow the `:headers` option when sending a request - Adds a test for this - Clean up deprecated test syntax (remove `should` in favor of `expect`) - Suppress `stdout` during test runs to clean up test output - Bump the version number and add to the changelog.
@@ -10,7 +10,7 @@ module PublishingMethods | |||
# | |||
# @return the JSON response from the API | |||
def add_event(event_collection, properties, options={}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove the options={}
here, now that it is unused?
uri = URI.parse(url) | ||
Keen::HTTP::Sync.new(self.api_url, self.proxy_url, self.read_timeout).get( | ||
:path => "#{uri.path}?#{uri.query}", | ||
:headers => api_headers(self.read_key, "sync") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an api_headers
method that can be removed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we still use api_headers
, in the request_headers
function.
@@ -20,7 +20,7 @@ def delete_url(event_collection, filter_params=nil) | |||
it 'should not require filters' do | |||
url = delete_url(event_collection) | |||
stub_keen_delete(url, 204) | |||
client.delete(event_collection).should == true | |||
expect(client.delete(event_collection)).to be true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, you monster.
:headers
option when sending a requestshould
in favor ofexpect
)stdout
during test runs to clean up test output