Inserting new contacts through REST
We now know we can use REST requests to get data from SharePoint lists, how about adding data to the list from the client applications? In this recipe, we will see how to do just that.
Getting ready
You need to have completed the previous recipes and understand the REST calls that are made in the previous recipes.
How to do it...
In order to insert a new contact through REST, adhere to the following steps:
Open Visual Studio 2010, and create a console application project.
Name the project RESTUpdate. Visual Studio will create the necessary files and bring you to
Program.cs
. This is where you will write your code to add the new contact.Right-click on the references and click on Add Service Reference. This will bring up the Service Reference wizard.
Add the
ListData.svc
URL to your server in the address bar, and click on the Go button. Services will be listed in the Services List box. Use the default for Namespace and click on the OK button. Visual Studio will...