OData protocol is REST based protocol, which internally uses the HTTP for communication. It also defines how the OData model (Entity Data Model) will be available in wire.
Similar to REST, all the resource from service are queried using URL and it uses standard REST based verbs for communication like
- GET: Reads data from entities
- PUT: Updates an existing entity
- POST: Creates a new entity
- DELETE: Removes an entity
- MERGE: Updates an existing entity, but replaces only specified properties
Data model exposed from OData service can be views by appending "$metadata" in query url, which returns the EDM schema in xml format and it is called as "conceptual schema definition language (CSDL),"
Example: http://localhost/ODataSample_01/MyODataService.svc/$metadata
OData uses the same type of authentication mechanism like REST to secure the data. It uses HTTP Basic Authentication over SSN. It can also use OAuth to authenticate based on the scenario.
OData provides two set of option to serialize and transfer data through network using OData protocol. Most commonly Atom type is used for communication.
- Atom/AtomPub (feeds)
- JSON
Below diagram explains about how the data from relation data source is mapped to oData data model and then to Atom data model