根据GitHub REST API,要列出在GitHub Pull Request上发布的评论,我们需要将URL地址放在一起:
/repos/:owner/:repo/pulls/:pull_number/comments
此URL中有三个参数::owner
,:repo
和:pull_number
。
这是一个curl
命令行示例,该示例在一个“拉取请求”中获得json
响应:
curl "https://api.github.com/repos/37signals/sub/issues/2/comments" -v
让我们将该URL分解...
:owner
在这里是37signals
。:repo
是sub
。:pull_number
是2
我正在使用的请求请求是:
https://github.prod.mycompany.com/MyTeamName/MyRepoName/pull/3
同样,为了将GitHub API URL
地址放在一起,我需要:owner
,:repo
和:pull_number
。
我尝试过:
curl https://api.github.com/repos/mycompany/MyRepoName/issues/3/comments -v
但是它返回Not Found
错误。
提出API请求的正确URL是什么?
通过Github Enterprise,我们提供了许多不同的API URL,我们都可以使用它们: