Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is OData RESTful?

Tags:

rest

uri

odata

I am writing an WEB API project where I use OData for advcened querying of resources. The service should be RESTful. But I am not sure if OData is RESTful because of URI format.

Everywhere I look REST URI format looks like this

http://example.com/resources/142

But OData URI format should be like this

http://example.com/resources(142)

I am not sure if both is right for REST or OData is not completly RESTful.

like image 477
zdarsky.peter Avatar asked Oct 31 '14 09:10

zdarsky.peter


People also ask

Is OData a RESTful API?

OData Published as an ISO StandardOData RESTful APIs are easy to consume. The OData metadata, a machine-readable description of the data model of the APIs, enables the creation of powerful generic client proxies and tools.

Is OData SOAP or REST?

ODATA is derivative of REST or built on top of it. - It is approved from International Organization for Standardization (ISO) & International Electrotechnical Commission (IEC) for release.

What is REST API in SAP OData?

An application programming interface (API) allows you to access data, for example, monitoring data. The OData API is implemented as a REST API and the technical protocol is Open Data Protocol (OData). This means that you can use standard HTTP methods (for example, the GET method) to call the API.

What is difference between OData and Web services?

OData is a protocol for building REST-based CRUD data services. OData services deliver data in a structured format such as JSON or ATOM. The term "Web Service" is much broader. OData services are a type of web service as are other REST-base services which aren't based on OData, or SOAP-based services etc.

Is OData a REST API or not?

The OData protocol is built on top of the AtomPub protocol. The AtomPub protocol is one of the best examples of REST API design. So, in a sense you are right - the OData is just another REST API and each OData implementation is a REST-ful web service.

What is OData and why is it important?

OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. OData helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers,...

What is the difference between OData and resource based protocol?

Resource based means that data and functionalities are considered as resources. OData is a web based protocol that defines a set of best practices for building and consuming RESTful web services. OData is a way to create RESTful web services thus an implementation of REST.

What is open data protocol (ododata)?

OData (Open Data Protocol) is an OASIS standard that defines the best practice for building and consuming RESTful APIs.


1 Answers

If the service you're writing should be RESTful, and you are worried about URI format, then you should do some research on the subject, because URI semantics are entirely irrelevant to REST.

The only constraints REST imposes on URIs is that they are treated as atomic identifiers, meaning they can't be split in parts in order to be understood, and that one URI identifies one and only one resource. Other than that, URI semantics and format are irrelevant. What matters to REST is how the client gets the URI. If they are reading URI patterns from documentation and filling placeholders with values, then that's not RESTful. You should do some research on HATEOAS if that's new for you.

like image 174
Pedro Werneck Avatar answered Sep 22 '22 21:09

Pedro Werneck