4.2.3 Retrieve a Single Entity by Using the Verbose JSON Format
The following example illustrates the exchange of messages that is required for a client to retrieve a Customer entity with an EntityKey value that is equal to "ALFKI" by using the Verbose JSON format.
Request:
-
GET /service.svc/Customers('ALFKI') HTTP/1.1 Host: host Accept: application/json;odata=verbose DataServiceVersion: 1.0 MaxDataServiceVersion: 3.0
Response:
-
HTTP/1.1 200 OK Date: Fri, 12 Dec 2008 17:17:11 GMT Content-Type: application/json;odata=verbose Content-Length: nnn ETag: W/"X'000000000000FA01'" DataServiceVersion: 3.0 {"d": { "__metadata": { "uri": "Customers(\'ALFKI\')", "type": "SampleModel.Customer", "etag": "W/\"X\'000000000000FA01\'\"" "properties" : { "Orders" : { "associationuri" : "Customers(\'ALFKI\')/SampleModel.Customer/$links/Orders ", }, }, "CustomerID": "ALFKI", "CompanyName": " Alfreds Futterkiste", "Address": { "Street": "57 Contoso St", "City": "Seattle", "Location": { "crs": { "type": "name", "properties": { "name": "EPSG:4326" } }, "type": "Point", "coordinates": [-127.9324, 49.2345] } }, "Version": "AAAAAAAA+gE=", "Orders": { "__deferred": { "uri": "Customers(\'ALFKI\')/SampleModel.Customer/Orders" } } } }