0

I am successfully making a Rest request as follows: Is there a way to trace the headers of the request and response

    prepareEndPoint();
    System.debug(endPoint);
    HttpRequest req=new HttpRequest();
    req.setEndpoint('Callout:EFS_URL/'+endPoint);
    req.setMethod('GET');
    req.setHeader('APP-UserID',efsUserId);
    req.setHeader('APP-Password',efsPassword);
    req.setHeader('MFC-ConversationUID','79832fec-796c-4dab-bdae-a28e7288e421');
    req.setHeader('MFC-ApplicationName','SFDC');
    req.setHeader('MFC-RequestDateTime','2015-09-19T01:13:57');
    req.setHeader('Content-Type','application/xml');
    req.setCompressed(true);
    Http http=new Http();
    System.debug(req);
    HttpResponse res=http.send(req);
    resultSet=res.getBody();
2
  • Do you want a trace only for debugging or you have to log it?
    – manjit5190
    Commented Sep 20, 2015 at 17:02
  • just wana use it for debugging purpose only. Is there any other apart from System.debug.-- like use of fiddler. For .Net I am able to use Fiddler, but for Salesforce I am not Commented Sep 20, 2015 at 17:25

1 Answer 1

1

If you want to use it for debugging only but don't want to use System.debug , then you can track the request by

  1. Creating a separate object and inserting a record for both request and response. (It will create a lot of records)
  2. Sending an email with request and response as body(May hit your daily email limit)
  3. Sending a request to RequestBin(www.requestb.in). It is site on which you can create your own bin and set the generated URL as the request endpoint. Then you can go to that bin and see the headers and request body. You cannot track responses via RequestBin unless other system is sending responses to RequestBin as well.

(It is free and I'm not affiliated to RequestBin)

P.S. Request bin URL should be added to remote site as well.

www.requestb.in

Sample Request

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .