tentacat icon indicating copy to clipboard operation
tentacat copied to clipboard

Support for .diff and .patch mediatypes

Open smetana opened this issue 8 years ago • 2 comments

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

smetana avatar Sep 12 '16 13:09 smetana

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

gvaughn avatar Feb 16 '17 01:02 gvaughn

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

smetana avatar Feb 16 '17 11:02 smetana