Hi Andrey,

You can place the unescaped string into a variable (e.g. "$var"), then use the {s.escape.user} transformation.
e.g.:
    $var(query) = "username=john smith&password=hard,to#guess";
    xlog("after: \"$(var(query){s.escape.user})\"\n");

    rest_get("http://localhost/?$(var(query){s.escape.user})", ...);


(output)
after: "username=john%20smith&password=hard,to%23guess"

Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 15.09.2015 23:41, Andrey Vorobiev wrote:
Hi,

I try to use REST_CLIENT (OpenSIPS version 1.11) module in order perform HTTP GET request with params in URL query part. Some of parameters may contain space characters and need to be encoded according to http://www.w3schools.com/tags/ref_urlencode.asp. It seems that REST_CLIENT module doesn't encode specified URL. So what function or script transformation should I use in order to encode HTTP query params values?

--
Best regards.


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to