I am trying to use the Salesforce sObject Collections REST API resource that was released in Spring '18. Per the Salesforce Documentation, this should be a PATCH request, however when I try to call this resource via curl I receive <h1>Bad Message 400</h1><pre>reason: Bad Request</pre>
error. My curl command:
curl "https://org.salesforce.com/services/data/v43.0/composite/sobjects" -X PATCH -H "Content-Type: application/json" -d "{ \"allOrNone\" : true, \"records\" : []}" -H "Authorization: token"
However, when I run this command as a POST, and add in the PATCH method as part of the URL, the command works correctly.
curl "https://org.salesforce.com/services/data/v43.0/composite/sobjects?_HttpMethod=PATCH" -H "Content-Type: application/json" -d "{ \"allOrNone\" : true, \"records\" : []}" -H "Authorization: token"
Any idea why? Am I reading the Salesforce documentation incorrectly?