【发布时间】:2014-09-15 19:37:41
【问题描述】:
我正在尝试在服务上使用 Json 进行深度插入,http://services.odata.org/(S(egpbfjhhvili4slwaq1p2lvt))/V2/OData/OData.svc/Categories with body--
{
"d" : {
"__metadata": {
"uri":"http://services.odata.org/(S(egpbfjhhvili4slwaq1p2lvt))/V2/odata/OData.svc/Categories(0)", "type": "ODataDemo.Category"
}, "ID": 97, "Name": "Food", "Products": [
{
"__metadata": {
"uri":"http://services.odata.org/(S(egpbfjhhvili4slwaq1p2lvt))/V2/odata/OData.svc/Products( 0)", "type": "ODataDemo.Product"
}, "ID": 97, "Name": "Bread", "Description": "Whole grain bread", "ReleaseDate": "\/Date(694224000000)\/", "DiscontinuedDate": null, "Rating": 4, "Price": "2.5", "Category": {
"__deferred": {
"uri":"http://services.odata.org/(S(egpbfjhhvili4slwaq1p2lvt))/V2/odata/OData.svc/Products(0)/Category"
}
}, "Supplier": {
"__deferred": {
"uri":"http://services.odata.org/(S(egpbfjhhvili4slwaq1p2lvt))/V2/odata/OData.svc/Products(0)/Supplier"
}
}
}
]
}
}
我收到带有错误描述的 400 Bad 请求:
{
error: {
code: ""
message: {
lang: "en-US"
value: "Error processing request stream. The property name 'd' specified for type 'ODataDemo.Category' is not valid."
}-
}-
}
有人可以帮我弄清楚我在这里做错了什么吗?
【问题讨论】:
标签: java json odata rest-client