【发布时间】:2017-09-14 03:21:09
【问题描述】:
我一直在关注 tfs 上的 microsoft 文档 https://www.visualstudio.com/en-us/docs/integrate/api/git/pull-requests/pull-requests https://www.visualstudio.com/en-us/docs/integrate/get-started/rest/basics
所以,我正在尝试使用以下命令通过终端创建pull request。
curl -X POST -k -u myUser:<Personal_Access_Token> -H "Content-Type: application/json" -d '{"sourceRefName": "refs/heads/fte", "targetRefName": "refs/heads/dev", "title": "test api", "description": "another test for pr with rest api", "reviewers": [ { "id": { null } } ] }' https://<installname>/<Projects>/_apis/git/repositories/<git_repository>/pullRequests?api-version=3.0-preview
但是服务器没有返回任何东西
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:05:00 --:--:-- 0
curl: (28) Operation timed out after 300453 milliseconds with 0 out of 0 bytes received
不过,我可以使用 curl 命令在 TFS 服务器上执行 GET resquest(例如:列出项目/存储库等)。但POST 似乎不起作用。
注意:我不确定在哪里可以找到 tfs 中的 reviewer id (guid),所以我将其分配为 null。我希望这不会引起这里的问题。
感谢任何建议/解决方案。
【问题讨论】:
-
澄清:我提到“我可以使用 curl 命令在 TFS 服务器上执行 GET resquest(例如:列出项目/存储库等)。但 POST 似乎不起作用。” ...查看我的终端历史记录,与 POST 不同,我为 GET 使用了正确的端点