You need to sign in to do that
Don't have an account?
Error: Method does not exist or incorrect signature: [http].send(System.HttpRequest)
Hai All,
Now the Apex code is fine and working.
When iam modifying small change in apex code its showing an Error
Compile Error: Method does not exist or incorrect signature: [http].send(System.HttpRequest)
and my apex,what i wrote in my controller is
public string php(blob attpdf){
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('https://sfarchive.com/generatePDF.php');
req.setMethod('POST');
req.setBodyasBlob(attpdf);
req.setCompressed(true); // otherwise we hit a limit of 32000
try {
res = http.send(req); ------> here its showing error.
} catch(System.CalloutException e) {
System.debug('Callout error: '+ e);
System.debug(res.toString());
}
return null;
}
Can anyone tell me the solution...
It might be just a naming clash - as http is both the type and the variable name, it may be that apex considers
http.send(req);
to be an attempt to access a static method on the http class.
Try changing your variable name to myHttp or similar.