How can i make an upsert callout? I have object Contact with custom ExtId with Custom_Object__c id. So i am tried post, patch method and without/with '?_HttpMethod=PATCH'; What do i need to do? I can only update or insert. HttpRequestHandler just do common part.
Map<String, String> headers = new Map<String, String>();
headers.put('Authorization', 'Bearer ' + credentials.Access_Token__c);
headers.put('Content-Type', 'application/json');
headers.put('accept', 'application/json');
`String endpoint = 'https://login.salesforce.com/services/data/v52.0/sobjects/contact/' + contact.ExtId__c + '?_HttpMethod=PATCH';`
HttpRequestHandler req = new HttpRequestHandler ('PATCH', body, endpoint, credentials, headers);