Convert Actual XML in url encoded ascii format
I am using REST API for our performance testing. Once we are able to deal with SLL we have to send the actual XML in server accepting format.
Server is design in that way it will accept only url encoded ascii format. So, we have to convert actual xml to url encoded ascii format and replace "\\+" with "%20".
Below piece of code we are uinsg while automation.
"XML=" + (java.net.URLEncoder.encode(actual, "ASCII").replace("\\+", "%20")).trim();
Can any one help me how to perform same task through LR Scripting.
Re: Convert Actual XML in url encoded ascii format
You can use the function web_convert_param(), take as target encoding URL.
When you want to convert a '+' to %20 in the result you have to manually fix that with some C functions.
You might not need that, depending on how you perform your decoding at your server. When your server is using java.net.URLDecoder.decode(), you will be fine.
Reward community members who take time to respond and help.