2

This question already has an answer here:

I must use this patch http callout. Is any one has idea?

http://developers.goformz.com/docs/update-an-existing-data-source-1

I get error

"Invalid HTTP method: PATCH"

Exception.

In our project need to use this callout. Is any other way to update the record from salesforce to goformz record?

HttpRequest req= new HttpRequest();
        req.setMethod('PATCH');
        req.setHeader('Content-Type','application/json');
        String username = 'username123@email.com';
        String password = 'password123'; 
        Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        req.setBody('{"name": "DE-111","fields": {"7f91803f-fed6-41cb-b506-a62d01500de0": { "text": "Test Street1111"  } }}');
        Http http = new Http(); 
        String url = 'https://api.goformz.com/v2/formz/4bc24f7f-bac8-4632-97b6-a640005becb8';
        req.setEndpoint(url);
        HttpResponse res = http.send(req);

marked as duplicate by Eric, Martin Lezer, Santanu Boral, Markus Slabina, martin Jun 30 '17 at 0:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Use the below code

req.setHeader('X-HTTP-Method-Override','PATCH');
req.setMethod('POST');
  • Could you add some explanations? – Martin Lezer Jun 29 '17 at 19:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.