Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Callback URL :
CSS
curl https://na1.Host.com/services/data/v20.0/sobjects/Account/ -H "Authorization: Bearer token -H "Content-Type: application/json" -d "@newaccount.json" -X PATCH 

Example request body newaccount.json file
JavaScript
{
"Name" : "Express Logistics and Transport"
}


I want to call web request using above callback url and data.

My code :
C#
using (WebClient client = new WebClient())
{
     client.Headers.Add("Authorization", "Bearer " + token.access_token);
     client.Headers.Add("Content-Type", "application/json");
     NameValueCollection reqparm = new NameValueCollection();
     reqparm.Add("Name", "This Is Test Data");
     byte[] responsebytes = client.UploadValues(token.instance_url + "/services/data/v20.0/sobjects/Account/", "PATCH", reqparm);
     string responsebody = Encoding.UTF8.GetString(responsebytes);
}

Above code is not working. Getting Error (405) Method Not Allowed. I don't know how to use Patch Method.
Posted
Updated 18-Apr-15 23:01pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900