Creating a REST consumer
In this recipe, we will use the SharePoint REST APIs to retrieve data from the SharePoint list to display in a Windows application.
Getting ready
You need to have completed the previous recipes and understood the REST calls that were made in the previous recipes.
How to do it...
In order to create a REST consumer, adhere to the following steps:
Open Visual Studio 2010 and create a
Windows
Forms
Application project.Name the project RESTConsumer.
Visual Studio will create the necessary files for the Windows project and should bring up the project with an empty form as follows:
Add a list box and a button as shown in the previous screenshot and name the list box as listContacts and the button btnGetData. Change the label on the button to Get Data. The completed form is as shown in the previous screenshot.
Right-click on the references and click on Add Service Reference. This will bring up the Service Reference wizard as shown in the following screenshot:
Alternatively, you...