Hello,
I have been able to successfully create a new list item using the HttpWebRequest object and REST, but when I try to update an item I am running into an error I can't seem to get by. I'm sure it's a formatting issue, but I just don't see it. Any help would be appreciated.
Using Fiddler the raw data I'm generating and sending with the HttpWebRequest object is:
POST http://server/site/_api/web/lists(guid'c41771de-810b-4659-9992-57ce41112973')/Items(3681) HTTP/1.1
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose
X-RequestDigest: 0x172553B80E32472D3595D4F61A34BA4666471D2C74D5DB99FE9D9AEC8C5C688F5950D0551EAB89A35EADBEA430220030AF0C44B1D5A461BCB39E2B3D4B663869,04 Jun 2013 14:24:07 -0000
Host: sp
Content-Length: 107
Expect: 100-continue
{ '__metadata' : { 'type' : 'SP.Data.Employee_x0020_ListListItem' }, 'EE_x0020_User_x0020_name': 'Changed'}
The result is a 400 Bad Request and the body is:{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The parameter __metadata does not exist in method GetById."}}}
Thanks in advance.
Mike