• Krisztian Valko 5
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

Hi Guys,

I am triggering a POST request via process builder and it works but can you please tell me how can I capture the HTTP response I get back? The external system will send me a string I would like to store on the record which started the process. 
 

@future(callout=true)

        public static void calloutmethod(String name){
                Http http = new Http();
                HttpRequest request = new HttpRequest();
                request.setEndpoint('XXX');
                request.setMethod('POST');
                request.setHeader('Content-Type', 'application/json;charset=UTF-8');
                request.setHeader('accept', 'application/json');
                request.setBody(name);
                
                response = http.send(request);
        }

Thanks a lot.

Krisz

Hi Guys,

I am triggering a POST request via process builder and it works but can you please tell me how can I capture the HTTP response I get back? The external system will send me a string I would like to store on the record which started the process. 
 

@future(callout=true)

        public static void calloutmethod(String name){
                Http http = new Http();
                HttpRequest request = new HttpRequest();
                request.setEndpoint('XXX');
                request.setMethod('POST');
                request.setHeader('Content-Type', 'application/json;charset=UTF-8');
                request.setHeader('accept', 'application/json');
                request.setBody(name);
                
                response = http.send(request);
        }

Thanks a lot.

Krisz