You need to sign in to do that
Don't have an account?
A Me
Patch callouts from Salesforce not supported.
We need to make calls from Salesforce (using Apex) to an external REST Api and in some calls we need to make a PATCH callout. Why doesn't Salesforce allow making patch callouts?
Its a big issue because its a standard Http method used by many Rest Apis , and Salesforce doesn't support it. I have tried using the workarounds mentioned in one of the ideas https://success.salesforce.com/ideaView?id=0873A000000PST0QAO
Option 1 : adding "?_HttpMethod=PATCH" to the endpoint , and using method = POST or PUT
Unfortunately this workaround doesnt work if the Rest API one tries to access doesn't allow it, as in my case. Response received is "method not allowed"
Option 2 : Set the method to "POST" and this line is added to code
req.setHeader('X-HTTP-Method-Override','PATCH');
This doesn't work either and the error message is same as the previous one.
This is a deadend. Unless Salesforce enables PATCH callouts or there is a workaround that would work.
Can someone help please?
Its a big issue because its a standard Http method used by many Rest Apis , and Salesforce doesn't support it. I have tried using the workarounds mentioned in one of the ideas https://success.salesforce.com/ideaView?id=0873A000000PST0QAO
Option 1 : adding "?_HttpMethod=PATCH" to the endpoint , and using method = POST or PUT
Unfortunately this workaround doesnt work if the Rest API one tries to access doesn't allow it, as in my case. Response received is "method not allowed"
Option 2 : Set the method to "POST" and this line is added to code
req.setHeader('X-HTTP-Method-Override','PATCH');
This doesn't work either and the error message is same as the previous one.
This is a deadend. Unless Salesforce enables PATCH callouts or there is a workaround that would work.
Can someone help please?