4.2 Retrieve Books by a Specific Author
In this example, a protocol client requests information about all of the books that are associated with the author named Soha Kamal.
The protocol client sends the following message including some HTTP headers:
-
GET /_vti_bin/client.svc/SampleCode.BookStore.Catalog/Books?$filter=Author%20eq%20'Soha%20Kamal' HTTP/1.1 Host: www.example.com Accept: */*, application/json Content-Type: application/json
The protocol server responds with the following message including some HTTP headers:
-
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "d":{ "results":[ { "__metadata":{ "id":"a2ac7976-b585-4217-850c-c18a273da35c", "uri":"http://www.example.com/_vti_bin/client.svc/SampleCode.BookStore.Catalog/Books('3387ac63-e73d-421f-bff7-359a4aa2bc38')", "type":"SampleCode.Book" }, "Author":"Soha Kamal", "Id":"3387ac63-e73d-421f-bff7-359a4aa2bc38", "PublishDate":"\/Date(1204329600000)\/", "Status":0, "Title":"How to Cook Chinese Food" },{ "__metadata":{ "id":"1449675e-0d53-435f-9953-c23c36a15c4e", "uri":"http://www.example.com/_vti_bin/client.svc/SampleCode.BookStore.Catalog/Books('f6a265ab-86e5-4fbf-937c-49923604b91d')", "type":"SampleCode.Book" }, "Author":"Soha Kamal", "Id":"f6a265ab-86e5-4fbf-937c-49923604b91d", "PublishDate":"\/Date(1178236800000)\/", "Status":1, "Title":"How to Cook Japanese Food" } ] } }
-