on 06-13-2017 10:10 AM
Hi,
I try to call an XSJS Service with a mobile number as an parameter.
******.xsjs?cmd=read&key='(+49) 123 456 7890'
In the job the + sign is removed.
Here ist my code.
var aCmd = $.request.parameters.get('cmd');
switch (aCmd) {
case "read":
var key2 = $.request.parameters.get('key');
read(key2);
break;
default:
$.response.status = $.net.http.BAD_REQUEST;
$.response.setBody('Invalid Command');
}
Any hints, what to do ?
Thanks Klaus
You have to encode the value you are passing to the parameter. If your client calling the service is a JS client, you can use the function encodeURIComponent. On server side in the xsjs coding, you can use function decodeURIComponent to get the original value.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is the issue. As mentioned you have to encode the passed value.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.