Skip to content

Get pull request diff from API #24460

Answered by gr2m
n6g7 asked this question in API and Webhooks
Discussion options

You must be logged in to vote

You have to pass a custom Accept header to request a different media format. 

Example

$ curl -i --header "Accept: application/vnd.github.v3.diff" https://api.github.com/repos/gr2m/sandbox/pulls/7
HTTP/1.1 200 OK
Date: Sat, 02 Mar 2019 22:28:15 GMT
Content-Type: application/vnd.github.v3.diff; charset=utf-8
Content-Length: 172
Server: GitHub.com
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1551569262
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept
ETag: "89a4add058d68717026fe382008df964"
Last-Modified: Wed, 13 Feb 2019 17:03:03 GMT
X-GitHub-Media-Type: github.v3; param=diff
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants