Reputation: 2169
I have this question on OData based services. As a consumer of OData Service, can I assume that any OData compliant data service would expose its data in ATOM and JSON format.
Is it possible that there is a OData service that expose its feeds in ATOM but not in JSON format?
In my application as a consumer of OData (OData CLient) we are always fetching the data in JSON format. This would fail when the OData Service only supports ATOM.
Upvotes: 2
Views: 3943
Reputation: 270
From the specification, I think the ATOM is default way for OData data feed. and it can be easy to convert to JSON with ?$format=json may be you can try to use ?$format=atom
Upvotes: 2
Reputation: 11457
The specification has changed again in OData Version 4.0:
An OData service MUST support at least one of [OData-JSON] or [OData-Atom], and MAY support additional formats for both request and response bodies.
Upvotes: 4
Reputation: 126205
The V3 documentation is unambiguous:
Upvotes: 2
Reputation: 13320
The specification talks about both ATOM and JSON, but in reality not all services support both. I've seen a couple which only supports ATOM for now. So yes, it is possible to expose an OData services which only supports for example ATOM. Whether such service complies with the specification is kind of not interesting, since if you can't consume ATOM you won't be able to talk to such service regardless of the specification.
Upvotes: 3