2017-09-13 53 views
1

我对TFS 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建立在TFS 2017年使用卷曲(内部)

所以,我试图通过使用下面的命令终端创建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 

我虽然执行GET resquest使用curl命令TFS服务器上回来(的东西,如:列出项目/库等)。但POST似乎没有工作。

注意:我不确定在哪里可以找到tfs中的reviewer id(guid),所以我将它分配为null。我希望这不会引起问题。

任何建议/解决方案表示赞赏。

+0

澄清:我提到“但我可以使用curl命令在TFS服务器上执行GET resquest(例如:列出项目/存储库等),但POST似乎不起作用。” ...查看我的终端历史记录,与POST不同,我使用正确的端点进行GET – OK999

回答

2

这对我来说是一个愚蠢的错误与https端点。我被指定端口8080,而我正在试图使用https ..所以畸形端点看起来像

https://somename.com:8080/blah 

我改成了

https://somename.com/blah 

和它的工作