+ Start a Discussion
mba75mba75 

Restful web service replace '&' with '&'

I send the following

String endpoint=http://www.ffc.com/wsbin/wsbulk.dbw?SENDER=User&PASSWORD=pwd+&TEXT=msg&RECIPIENT=+Recipient;

req.setEndpoint(endpoint);

HTTPResponse res = http.send(req);

 

 

res coming back like that:

Invalid URL http://www.ffc.com/wsbin/wsbulk.dbw?SENDER=User&PASSWORD=pwd&TEXT=msg&RECIPIENT=Recipient;

 

 

any idea

TomSnyderTomSnyder
        include the following:
 
req.setMethod('GET');
        req.setHeader('Content-Type','application/x-www-form-urlencoded');
mba75mba75

Thank you tesii.

 

I'll already try that and it does not change anything

 

req.setMethod('POST');

req.setHeader('Content-Type','application/x-www-form-urlencoded');

TomSnyderTomSnyder

are you writing the apex code using the force.com IDE?

 

I know some browsers have issues with the '&' encoding,  chrome in particular.

 

I assume the issue is not w/ the & just the service,  and the return is innaccurate.  does it work correctly from browser?

 

 

 

 

mba75mba75

That's right I use eclipse to write my code. and it works correctly from my browser (IE7).