+ Start a Discussion
eswarsfeswarsf 

REST Http PUT request is giving error in Google oAuth playground

Hi,

I am playing around with Google oAuth playground.I got success in HTTP GET,HTTP DELETE,HTTP POST requests.But when I tried HTTP PUT it was throwing me below error.

 

"{
"message" : "HTTP Method 'PUT' not allowed. Allowed are HEAD,GET,PATCH,DELETE",
"errorCode" : "METHOD_NOT_ALLOWED"
}"

 

Kindly let me know how can I update salesforce records?

 

Thanks,

Best Answer chosen by Admin (Salesforce Developers) 
ChrisOctagonChrisOctagon

If you are not able to use PATCH, you could try sending a POST and using the query parameter "_HttpMethod" set to "PATCH" to fake it, as described in the top answer here: http://stackoverflow.com/questions/6870677/cf8-and-salesforce-rest-api-updating-records

All Answers

SuperfellSuperfell

As per the docs, you use PATCH to update existing records.

eswarsfeswarsf

Hi Simon,

but this PATCH operation is not available in Google oAuth playground.

 

Thanks,

ChrisOctagonChrisOctagon

If you are not able to use PATCH, you could try sending a POST and using the query parameter "_HttpMethod" set to "PATCH" to fake it, as described in the top answer here: http://stackoverflow.com/questions/6870677/cf8-and-salesforce-rest-api-updating-records

This was selected as the best answer