2011-05-28 19 views
0

如果我有一個集合/Events(123)/Registrants,並且我想爲該集合添加一個Person,我該如何做這樣的事情。 我試過POSTing a Person到那個URL,但是我得到一個錯誤。如何添加到oData中的嵌套集合

回答

0

我不懂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>