我想HTTP-PUT一个实体/ entitySet的列表(我想这对于HTTP-POST来说是相似的)。下面是查询的主体。此查询在邮递员中工作。
{
"value": [
{
"@odata.type": "Demo.GridPoint",
"x": 2.2,
"y": 1.2
},
{
"@odata.type": "Demo.GridPoint",
"x": 4,
"y": 5
},
{
"@odata.type": "Demo.GridPoint",
"x": 1,
"y": 9
}
]
}Demo.GridPoint是ComplexType
我尝试创建一个ClientEntity并将不同的值添加为ComplexProperty
ClientEntity coordinates = client.getObjectFactory().newEntity(coordinatesFqn);
for(/* all grid Points */){
coordinates.add(client.getObjectFactory().newComplexProperty("", gridPoint));
}但是,函数newComplexProperty(String name, ClientComplexValue value)需要ComplexValue 和的名称。因此,所产生的查询不符合预期格式,因此失败:
{"@odata.type":"Demo.Coordinates",
"":{"@odata.type":"Demo.GridPoint","x@odata.type":"Double","x":2.2,"y@odata.type":"Double","y":1.2},
"":{"@odata.type":"Demo.GridPoint","x@odata.type":"Double","x":4,"y@odata.type":"Double","y":5}
"":{"@odata.type":"Demo.GridPoint","x@odata.type":"Double","x":1,"y@odata.type":"Double","y":9}
}一篇文章/如何列出一个实体/一个EntitySet?
发布于 2017-02-01 18:10:37
您可以添加对批处理请求的支持。它们允许你一次发送几个请求。
http://www.odata.org/documentation/odata-version-2-0/batch-processing/
https://stackoverflow.com/questions/41853322
复制相似问题