Open Data Protocol:
Open Data Protocol (OData) is an open protocol which allows the creation and consumption of queryable and interoperable RESTful APIs in a simple and standard way.
It is abstract data model and protocol used to access the information exposed by any data source.
In real time scenario, client application may need to read the data from different source using different data provider.
But it is always good to have single point of contact and mode to access the different sources; this can be easily achieved by using OData.
- OData uses URIs to identify resources. For every OData service whose service root is abbreviated as http://host/service/, the following fixed resources can be found:
The service document
- The service document lists entity sets, functions, and singletons that can be retrieved. Clients can use the service document to navigate the model in a hypermedia-driven fashion.
The metadata document
- The metadata document describes the types, sets, functions and actions understood by the OData service. Clients can use the metadata document to understand how to query and interact with entities in the service.
- Dynamic resources
The URIs for the dynamic resources may be computed from the hypermedia information in the service document and metadata document.
- OData leverages the HTTP verbs to indicate the operations on the resources.
- GET: Get the resource (a collection of entities, a single entity, a structural property, a navigation property, a stream, etc.).
- POST: Create a new resource.
- PUT: Update an existing resource by replacing it with a complete instance.
- PATCH: Update an existing resource by replacing part of it’s properties with a partial instance.
- DELETE: Remove the resource.
© 2015, admin. All rights reserved.