Tuesday, September 8, 2015

[WSO2 ESB] How to URL Encode in WSO2 ESB

You can do this using either Script mediator or Class mediator. Here I'm discussing about how to use Script mediator.

In javascript, there are 2 ways to do URL encoding.

1) encodeURIComponent() - This should be used only to encode query parameters.

eg. name=John Conner

2) encodeURI() - This is used to encode an entire URL.

eg. www.transformers.com/charactors?name=John Conner

If you have any questions, please comment below.

No comments:

Post a Comment