输入内容无效,因为所需的属性 - ' id; ' - 缺失

时间:2017-05-04 16:53:31

标签: azure-cosmosdb

尝试查询DocumentDB(使用Postman),我收到一个奇怪的错误:

{
  "code": "BadRequest",
  "message": "Message: {\"Errors\":[\"The input content is invalid because the required properties - 'id; ' - are missing\",\"The request payload is invalid. Ensure to provide a valid request payload.\"]}\r\nActivityId: 5fb02072-0f8f-4894-b53e-1fbb080d9303, Request URI: /apps/6c5e39d2-6966-4c0b-850c-3bc5fb78504b/services/25741218-2668-4ee6-a187-2c3cf09f4125/partitions/e93ec839-16e2-47c6-98bb-0423594a8781/replicas/131364849074398906p"
}

这是我的要求:

POST /dbs/Orders/colls/Orders/docs HTTP/1.1
Host: mydocumentdb.documents.azure.com:443
authorization: type%3Dmaster%26ver%3D1.0%26sig%3DgonnmkT1POU19FwPeO35MdJMQPcYGL1j9aVeLlhZViU%3D
Content-Type: application/json
x-ms-documentdb-isquery: true
x-ms-date: Thu, 04 May 2017 16:48:05 GMT
x-ms-version: 2016-07-11
x-ms-documentdb-partitionkey: [ "20 "]
x-ms-max-item-count: 10
Cache-Control: no-cache
Postman-Token: bec10c57-f3b3-5284-b8e2-2a7c65b5a790

{  
    "query": "SELECT * FROM Orders o WHERE o.ManufacturerID=@ManufacturerID",  
    "parameters": [ {  
      "name": "@ManufacturerID",  
      "value": "20"  
    }]  
}  

这是一个查询,所以我不确定为什么要查找ID

1 个答案:

答案 0 :(得分:0)

请尝试将Content-Type更改为application/query+json,我可以将请求发送到我的DocumentDB集合中查询文档,请参阅。

enter image description here