function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
palak agarwalpalak agarwal 

Request parameters in http callout from salesforce to java

hi all,

 

I am trying to call java servlet through apex using servlets. This works fine when i am not passing any parameter in the request like the one below:

req.setEndpoint('http://ec2-174-129-109-194.compute-1.amazonaws.com/examples/servlets/servlet/dmgevents')

 

but as soon as i attached parameters to  the request it starts giving status 500 error.

I am passing parameters as below:

 

req.setEndpoint('http://ec2-174-129-109-194.compute-1.amazonaws.com/examples/servlets/servlet/dmgevents?an=Autocomplete.docx&aid=a07M0000000hfXX&dn=shell1 - S-00003 - 20111111060421.doc');

 

 

Please help if anybody has idea about this issue.

 

with regards,

Palak

 

SrikanthKuruvaSrikanthKuruva

try either of the following

 

req.setMethod('GET');

or

req.setMethod('POST');