Open Data Protocol (OData)
What is OData?
•OData is anWeb Standard and Protocol that defines the
best practice for building and consuming RESTfulAPIs.
•OData helps you focus on your business logic while
building RESTfulAPIs without having to worry about the
approaches to define your APIs.
•OData RESTfulAPIs are easy to consume.
Some Basics about HTTP
These are the URLs you use to get to pages on the
These are additional instructions that are sent
with the request.These might define what type of
response is required or authorization details.
These describe what you want to do with the
resource. A browser typically issues a GET verb to
instruct the endpoint it wants to get data,
however there are many other verbs available
including things like POST, PUT and DELETE.
Data that is sent with the request. For example a
POST (creation of a new item) will required
some data which is typically sent as the request
body in the format of JSON or XML.
This is the main body of the response. If the
request was to a web server, this might be a full
Response Status codes
These codes are issues with the response and
give the client details on the status of the
Some Basics about HTTP -Verbs
Requests a representation of the specified resource.
Requests using GET should only retrieve data and
should have no other effect.
Requests that the server accept the entity enclosed in
the request as a new subordinate of the web resource
identified by the URI.
Requests that the enclosed entity be stored under the
Deletes the specified resource.
Some Basics about HTTP – Response Codes
Request received, continuing process.
This class of status code indicates a provisional
response, consisting only of the Status-Line and
optional headers, and is terminated by an empty line.
This class of status codes indicates the action
requested by the client was received, understood,
accepted and processed successfully.
This class of status code indicates the client must take
additional action to complete the request.
The 4xx class of status code is intended for cases in which the
client seems to have errored.
The server failed to fulfill an apparently valid request.
Response status codes beginning with the digit "5"
indicate cases in which the server is aware that it has
encountered an error or is otherwise incapable of
performing the request.
What is REST?
•REST stands for Representational State Transfer.
•An architectural style for building loosely coupled
•REST is not a "standard".There will never be aW3C
recommendataion for REST
•It relies on a stateless, client-server, cacheable
communications protocol -- and in virtually all cases, the
HTTP protocol is used.
What is REST?
How does OData use REST?
•ODataAPIs are just Collections ofTyped Entities
•OData services expose all these Resources via URIs
•OData services use HTTP Verbs to intereact with
•OData services can also expose Actions and Function for
How OData use HTTPVerbs?
HTTP Command (Verb) SQL Command
OData in 6 Simple Steps
1. Requesting Resources
2. Requesting an Individual Resource
4. Creating a New Resource
5. Relating Resources
6. Invoking a Function