开发者

How to add to a nested collection in oData

开发者 https://www.devze.com 2023-03-08 19:44 出处:网络
If I had a co开发者_运维百科llection /Events(123)/Registrants, and I wanted to add a Person to that collection, how would I do something like that.

If I had a co开发者_运维百科llection /Events(123)/Registrants, and I wanted to add a Person to that collection, how would I do something like that. I tried POSTing a Person to that url, but I get an error.


Stupid me for not reading the oData specification.

POST /OData/OData.svc/Events(123)/$links/Registrants HTTP/1.1
Host: services.odata.org
DataServiceVersion: 1.0
MaxDataServiceVersion: 2.0
Content-Length: 159
Content-Type: application/xml
<uri xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
http://services.odata.org/OData/OData.svc/Person(10)
</uri>
0

精彩评论

暂无评论...
验证码 换一张
取 消