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

Support for .diff and .patch mediatypes #96

Open
smetana opened this issue Sep 12, 2016 · 2 comments
Open

Support for .diff and .patch mediatypes #96

smetana opened this issue Sep 12, 2016 · 2 comments

Comments

@smetana
Copy link

smetana commented Sep 12, 2016

GitHub API allows to set Accept header to application/vnd.github.v3.diff and application/vnd.github.v3.patch to return raw diffs and patches. This raises error in Tentacat because response body is always processed by JSX.decode!. Even if it is not json

@gvaughn
Copy link

gvaughn commented Feb 16, 2017

I'm looking to get diffs from tentacat too. @smetana did you find a solution?

@smetana
Copy link
Author

smetana commented Feb 16, 2017

We use direct call to HTTPoison.get

 def get_diff(url, client) do
   headers = [{"Accept", "application/vnd.github.v3.diff"}]
   headers = Tentacat.authorization_header(client.auth, headers)
   response = HTTPoison.get!(url, headers)
   response.body
 end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants