Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Add Accept header to HEAD and GET #25

Merged
merged 2 commits into from
Nov 7, 2013
Merged

Add Accept header to HEAD and GET #25

merged 2 commits into from
Nov 7, 2013

Conversation

owenthereal
Copy link
Contributor

I need to confirm this, according to the doc, Accept header should be set. But octokit.rb only set it to HEAD and GET. Should I set it on all http verbs?

/cc @technoweenie @pengwynn

@pengwynn
Copy link
Collaborator

pengwynn commented Nov 7, 2013

We should send them for all verbs. Octokit.rb sends them on all HTTP verbs, but it does some cheating to pull the Accept and Content-Type headers from the method options hash for convenience for HEAD and GET.

This lets us do:

client.some_method :accept => "application/vnd.github.beta"

instead of:

client.some_method :headers => {:accept => "application/vnd.github.beta"}

LOL dynamic languages. 😸

@owenthereal
Copy link
Contributor Author

Ah, ok, so Accept is not set by default for verbs other than HEAD and GET? I meant it's passed in for other verbs than HEAD and GET

@pengwynn
Copy link
Collaborator

pengwynn commented Nov 7, 2013

No, it's set by default for all verbs here, sourced from here.

@owenthereal
Copy link
Contributor Author

That's what I thought. Thanks for the clarification. I fixed this pull request to send Accept on all verbs 😄 8c32ab8

owenthereal added a commit that referenced this pull request Nov 7, 2013
Add Accept header to HEAD and GET
@owenthereal owenthereal merged commit 3058c5c into master Nov 7, 2013
@owenthereal owenthereal deleted the accept_header branch November 7, 2013 17:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants