【问题标题】:Request to VSTS REST API only works on Postman对 VSTS REST API 的请求仅适用于 Postman
【发布时间】:2017-12-07 00:23:37
【问题描述】:

我正在尝试运行此请求

curl -X POST \
  'https://*****.visualstudio.com/DefaultCollection/_apis/wit/wiql?=&api-version=1.0' \
  -H 'authorization: Basic *****' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: *****' \
  -d '{
  "query": "SELECT [System.Id] FROM WorkItems"
}'

但我不断收到此错误

{"count":1,"value":{"Message":"A value is required but was not present in the request.\r\n"}}

它在 Postman 上按预期工作,所以我认为请求和服务器都可以。

我正在尝试遵循此处显示的第一个示例:https://www.visualstudio.com/en-us/docs/integrate/api/wit/wiql

我错过了什么吗?

【问题讨论】:

    标签: azure-devops postman azure-devops-rest-api


    【解决方案1】:

    URL 错误,从 REST API url 中删除 =&,url 将是这样的:

    https://*****.visualstudio.com/DefaultCollection/_apis/wit/wiql?api-version=1.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-15
      • 2018-08-23
      • 2022-01-21
      • 2017-08-06
      • 1970-01-01
      相关资源
      最近更新 更多