You need to sign in to do that
Don't have an account?
SK9
InvalidServiceRequestException StatusCode=851 when sending Http POST callout from Apex
Hi,
I am sending a Http Callout from Apex with a payload that contains data from multiple objects. When I test it, some of the records return success while some return this error -
System.HttpResponse[Status=Unknown, StatusCode=851]"|0x7d9abad5
{"exception_cls":"InvalidServiceRequestException","exception_msg":"Something went wrong, please check logs."}
I am assuming there is something in the Payload data which Salesforce is not able to transmit properly. When I send the same payload via CURL it succeeds, so there is no error on the receiving end as well. How should I proceed with this? Here is a sample of my code -
OpportunityCalloutHelper ih = new OpportunityCalloutHelper();
OpportunityCalloutHelper.ItineraryWrapper itiObj = ih.getItineraryWrapper(opp);
String itiObjStr = JSON.serialize( itiObj );
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(url);
req.setMethod('POST');
req.setBody(itiObjStr);
req.setHeader('Content-Type', 'application/json');
HttpResponse res = h.send(req);
I am sending a Http Callout from Apex with a payload that contains data from multiple objects. When I test it, some of the records return success while some return this error -
System.HttpResponse[Status=Unknown, StatusCode=851]"|0x7d9abad5
{"exception_cls":"InvalidServiceRequestException","exception_msg":"Something went wrong, please check logs."}
I am assuming there is something in the Payload data which Salesforce is not able to transmit properly. When I send the same payload via CURL it succeeds, so there is no error on the receiving end as well. How should I proceed with this? Here is a sample of my code -
OpportunityCalloutHelper ih = new OpportunityCalloutHelper();
OpportunityCalloutHelper.ItineraryWrapper itiObj = ih.getItineraryWrapper(opp);
String itiObjStr = JSON.serialize( itiObj );
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(url);
req.setMethod('POST');
req.setBody(itiObjStr);
req.setHeader('Content-Type', 'application/json');
HttpResponse res = h.send(req);