I'm starting a project that has to expose a RESTful service that will be consumed by a wide variety of clients of several OSs.
I'm reading about Web API and OData using Web API and it's hard for me to decide what to use, the plain Web API or the OData one.
What are some notable pros and cons?
Update
Would you guys be kind enough and comment on why this question is "primarily opinion based"? where exactly do you see any personal opinion here?
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. The difference is that OData is a specific protocol; REST is architecture style and design pattern.
The Open Data Protocol (OData) is a data access protocol for the web. OData provides a uniform way to query and manipulate data sets through CRUD operations (create, read, update, and delete). ASP.NET Web API supports both v3 and v4 of the protocol.
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, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc.
OData Published as an ISO Standard OData 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.
I've found this great post by Julie Lerman, that explains Web API and OData, and that OData is like a Web API with added a WCF-like feature set.
One of the features is easy prototypes of generic CRUD controllers.
The article is more detailed and clear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With