Get pull request diff from API #24460
-
Hello! I can’t find how to programmatically retrieve an entire PR diff from the API. I’m aware of
but I’m specifcally interested in private repositories, and this url doesn’t seem to accept tokens in the “Authorization” header. Using cookies is not an option in this case unfortunately. As far as I can tell there is no way to get that from either the v3 or the v4. Am I missing something? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I’m just going to bump this topic - I’ve been trying to figure out how to pull a PR diff from a github app, and it doesn’t seem to be possible? I would have thought looking at the contents of a PR would have been a super common use case, so I’m pretty baffled here. |
Beta Was this translation helpful? Give feedback.
-
You have to pass a custom Example
You can request It’s mentioned in the docs: https://developer.github.com/v3/pulls/#response-1 > Accept: application/vnd.github.v3.patch |
Beta Was this translation helpful? Give feedback.
-
Yep, this is what I was told to do by GitHub support and that’s exactly what I needed. 👍 |
Beta Was this translation helpful? Give feedback.
You have to pass a custom
Accept
header to request a different media format.Example