.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!



Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

OData with REST In SharePoint

Posted By:Jean Paul       Posted Date: April 30, 2016    Points: 200    Category: SharePoint    URL: http://www.dotnetspark.com  

In this article we will explore usage of REST with OData in SharePoint 2013.
 

In this post we can get introduced to OData along with REST.

REST

REST stands for Representational State Transfer. It is a stateless communication protocol using HTTP and ensuring HTTP verbs are accurately used for CRUD operations. Please see references for more information.

SharePoint 2013 supports REST services which enabled an easier & better communication from client-side. We can use REST for:

1. Getting site information using URL

2. Getting list information using URL

3. Getting list items using URL

An example of REST URL is:

http://server/_api/Web/Lists/GetByTitle('Contacts')

But, REST have drawbacks on querying and filtering. For example, using the URL format it is difficult to filter items.

OData

OData stands for Open Data Protocol. OData allows Filtering & Interoperability on REST services. We combine OData along with REST methods.

So REST + OData allows gives more flexibility in querying & filtering items.

Selecting Columns using OData

Following OData sample specifies selection of Title column only.

http://server/_api/Web/Lists/GetByTitle('Contacts')/Items?$select=Title

image

FYI: The above query without the Title selection is as following.

http://server/_api/Web/Lists/GetByTitle('Contacts')/Items

image

Although REST is stateless like HTTP, the sessions are stored in client-side and transferred back and forth from web server.

References

http://www.c-sharpcorner.com/UploadFile/40e97e/rest-enable-web-services-in-sharepoint/

https://en.wikipedia.org/wiki/Open_Data_Protocol

https://msdn.microsoft.com/en-us/library/office/fp142385.aspx

Summary

In this post we have explored usage of REST with OData in SharePoint 2013.  In the upcoming posts we can explore more options in OData.


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend