Hi Seenu_Mathew
Thanks ! ,
Below is an example of the requirement
We have an API provided by a vendor as below.
API URL : https://www.exmaple.com/v1/api/getdata?id=123456&type=vendor&email=example@gmail.com&data=sales&finance
The API expects the values of the Query Param to be URL encoded.
We tried passing the entire Query String for URL encoding, This will result in encoding of the "&" which is a delimiter of the Query parameter. And we don't want this to happen.
So now we are trying as below
- Split the Query String by "&" to get an multi valued variable which has all the Query parameter.
- multiValuedVariable[0] : id=123456
- multiValuedVariable[1] : type=vendor
- multiValuedVariable[2] : email=example@gmail.com
- multiValuedVariable[3] : data=sales&finance
- Iterate through Multi Valued variable
- Evaluate Regular Expression (.+=)(.+) to get the value after "="
- group 0 : data=sales&finance
- group 1 : data=
- group 2: sales&finance
- Encode the value captured in group 2 i.e after encoding "sales%26finance"
- Re join Group1+Encodedvalue to get data=sales%26finance and add in a multi valued variable
- The multi-valued variable will be joined again using "&" to get back the query string
The Problem in this logic is that it splits "sales&finance" . Which is a not delimiter, but its part of the data/value.