Using OData

datajs supports reading and writing to an OData service, using both the JSON and ATOM-based formats, including support for batch operations. The API is very simple and the library consists of only a few concepts. For more information on OData, see http://www.odata.org/.

You can use OData.read API with a URL to get data from a service, and the library will make sure that the reply comes in a consistent format. To add, update, or delete data, you can use OData.request API with a request that includes the POST, PUT or DELETE methods and an object in that same format, and the library will take care of serializing it into the correct format.

To get you started quickly, see OData Code Snippets.

For common cases, this is all you need to know to use OData. There are additional facilities to do more interesting things if you need more control, like tweaking the way the formatters work or the way that the library uses the network.
Previous Topic: Overview
Next Topic: OData Code Snippets

Last edited Jun 20, 2011 at 9:00 PM by marcelolr, version 3

Comments

No comments yet.