You need to sign in to do that
Don't have an account?
s_mac
Apex Call Outs(Rest)
I am making an call out to a service,by hitting an url provided by mule,this service will return a pdf in base64encoded format, I am getting the below error
Access control configuration prevents your request from being allowed at this time. Please contact your service provider....
Could anyone help how to resolve and acheieve this..
Thanks in Advance
Access control configuration prevents your request from being allowed at this time. Please contact your service provider....
Could anyone help how to resolve and acheieve this..
Thanks in Advance
public class HttpCallout {
public Blob basicCallout(){
Http p = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('http://10.201.xx..xxx:1024/res');
req.setMethod('GET');
req.setHeader('content-type','application/pdf');
HTTPResponse res = p.send(req);
String resbody= res.getBody();
system.debug('@@@@resbody@@@@'+resbody);
Blob beforeblob = res.getBodyAsBlob();
//string paramvalue = EncodingUtil.base64Encode(beforeblob);
String paramvalue = beforeblob.toString();
Blob afterblob = EncodingUtil.base64Decode(paramvalue);
System.debug('is now decoded as: ' + afterblob.toString());
return afterblob;
}
}