Reading resources

Resources from OData RESTful APIs are accessible via the HTTP GET request. For instance, the following GET request retrieves the Departments entity collection from the OData REST API server as follows:

GET http://localhost:8080/hrapp/odata/Departments HTTP/1.1 

The result that you may get from the OData REST API server in response to the preceding call will be structured in accordance with the OData protocol specification. This keeps the client code simple and reusable.

To read the individual resource element, you can pass the unique identifier for the resource, as shown in the following code snippet. This example reads the details of the department with the given ID:

GET http://localhost:8080/hrapp/odata/Departments(10) HTTP/1.1. 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.186.178