Thursday

What is REST?

What is REST?
  • REST is not a protocol, it's not a standard, it's an architectural design.
  • REST-style ListData.svc web service
  • Supports ADO.NET Data services
  • SharePoint becomes an ADO data service because of REST
  • SP2010 also installed ADO.NET services as these are what the REST API’s are built on
  • Work with data via (Representational State Transfer) It's a simple guidance that builds systems that focus on a resource centric approach.
  • It works mostly on LISTDATA Service.
  • Data organized as addressable resources. Uniform interface to act on them.
  • For example, if you say GET, it always means retrieve data from this system.

Why build REST into SharePoint?
  • It is a natural fit for SharePoint data
  • Item is equal to resource
  • Uniform interface and addressing scheme
  • Low barrier of entry, interoperability
  • Example 1: Using command prompt, we can POST data into the url that points at a SharePoint list and a new item gets added to the list. 
  • Retrieve an Item - GET
  • Create a new Item - POST
  • Update - PUT or MERGE
  • Delete - DELETE

  • Example 2: QueryString parameters for REST
  • $filter
  • $expand
  • $orderby
  • $skip
  • $top
  • $metadata
REST DEMO:

  • Builds a Windows Forms application
  • Adds a data source, service reference –> connects to LISTDATA
  • Binds a Grid on to the SharePoint List
  • Displays the Data.