首页 > 解决方案 > 在 PyGithub API 中设置 Accept Headers 以获取提交差异

问题描述

我想使用 PyGithub 获得以下查询的结果。有没有办法在 pygithub 中设置接受标头?我想要 diff 格式的输出,我不想使用 github compare API。

那么有没有办法使用pygithub提出以下请求?

curl \
  -H "Accept: application/vnd.github.diff" \
  http(s)://{hostname}/api/v3/repos/octocat/hello-world/commits/REF

标签: github-apipygithubgithub-api-v3

解决方案


推荐阅读