Skip to content
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

Merged
merged 1 commit into from
May 2, 2017
Merged

Allow sending arbitrary headers for requests #113

merged 1 commit into from
May 2, 2017

Conversation

hex337
Copy link
Contributor

@hex337 hex337 commented Mar 27, 2017

  • Allow the :headers option when sending a request
  • Adds a test for optional headers
  • 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.

- 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.
@hex337 hex337 requested a review from josephwegner May 2, 2017 18:13
@@ -10,7 +10,7 @@ module PublishingMethods
#
# @return the JSON response from the API
def add_event(event_collection, properties, options={})
Copy link
Contributor

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")
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Lol, you monster.

@hex337 hex337 merged commit 8424549 into keenlabs:master May 2, 2017
@hex337 hex337 deleted the send-custom-headers-with-each-request branch May 2, 2017 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants