4.4.2 Update a Relationship by Using the Verbose JSON Format

The following example illustrates the exchange of messages required for a client to update the association between the Order entity with EntityKey value 1 and its associated Customer. This example binds the Order 1 to Customer "ASDFG" by using the Verbose JSON format (section 2.2.6.3).

HTTP Request:

 PUT /service.svc/Order(1)/SampleModel.Customer/$links/Customer HTTP/1.1
 Host: host
 Content-Type: application/json;odata=verbose
 Content-Length: nnn
 DataServiceVersion: 1.0
 MaxDataServiceVersion: 1.0
  
 {"uri": "http://host/service.svc/Customers('ASDFG')"}

HTTP Response:

 HTTP/1.1 204 No Content
 Date: Fri, 12 Dec 2008 17:17:11 GMT
 DataServiceVersion: 1.0