You need to sign in to do that
Don't have an account?
Curiosity
Prevent URL encoding of web-service end points
Is there anyway to prevent URL encoding of the webservice endpoint which I want to callout to from my SFDC org? I am trying to call a webservice hosted on another non-SFDC public cloud from my SFDC org but the endpoint keeps getting URL encoded automatically by the time it reaches its destination.
To be more specific, I am trying to send across a security certificate as the request parameter and its value contans commas as a separator. But since URL encoding is proactively converting these commas to %2C the URL keeps failing at the webservice host which will not allow anything else but a literal comma. In my apex class which makes the callout I am NOT using EncodingUtil.urlEncode() to explicitly encode the endpoint but still it gets url encoded.
For example:
http://webservice.thirdparty.com/sfdcaccept?accessMode=r&auth=CN%3D01,OU%3DMyDept,OU%3DMyCompany,O%3MyWorkplace,C%3DAP&expiration=1653514361&secKey=xxxxxxx
is reaching the 3rd party webservice as...
http://webservice.thirdparty.com/sfdcaccept?accessMode=r&auth=CN%3D01%2COU%3DMyDept%2COU%3DMyCompany%2CO%3MyWorkplace%2CC%3DAP&expiration=1653514361&secKey=xxxxxxx
To be more specific, I am trying to send across a security certificate as the request parameter and its value contans commas as a separator. But since URL encoding is proactively converting these commas to %2C the URL keeps failing at the webservice host which will not allow anything else but a literal comma. In my apex class which makes the callout I am NOT using EncodingUtil.urlEncode() to explicitly encode the endpoint but still it gets url encoded.
For example:
http://webservice.thirdparty.com/sfdcaccept?accessMode=r&auth=CN%3D01,OU%3DMyDept,OU%3DMyCompany,O%3MyWorkplace,C%3DAP&expiration=1653514361&secKey=xxxxxxx
is reaching the 3rd party webservice as...
http://webservice.thirdparty.com/sfdcaccept?accessMode=r&auth=CN%3D01%2COU%3DMyDept%2COU%3DMyCompany%2CO%3MyWorkplace%2CC%3DAP&expiration=1653514361&secKey=xxxxxxx
Andy Boettcher
Any non-conforming URL characters will be converted automatically when it leaves Salesforce's servers - do you have an option to pass that information in a header or body of the request?