Forum Discussion

werdex's avatar
13 years ago

URL Encode in HTTP request

Hi folks,
I am having some problems trying to pass query parameter in url in HTTP Request:
http://localhost:8280/servicesFileUploa ... Id?token=${#TestCase#authorizationHeader}

I am trying to pass
Token as 'AQIC5wM2LY4SfczfyLI0w5e4dan7Jt8B4DlAIpp+RvZIPHw=@AAJTSQACMDE=#'

When token is passed as is then sopaui sends it as:
getUploadId?token=AQIC5wM2LY4SfczfyLI0w5e4dan7Jt8B4DlAIpp+RvZIPHw=@AAJTSQACMDE=
which is expected.

When token is encoded using groovy:
def token = properties.getPropertyValue("token");
def encodedToken = URLEncoder.encode(token,"UTF-8");
log.info("URL encoded token: " + encodedToken);
properties.setPropertyValue("encodedToken", encodedToken);

Encoded token becomes:
AQIC5wM2LY4SfczfyLI0w5e4dan7Jt8B4DlAIpp%2BRvZIPHw%3D%40AAJTSQACMDE%3D%23

Soapui sends it now with double encoding:
getUploadId?token=AQIC5wM2LY4SfczfyLI0w5e4dan7Jt8B4DlAIpp%252BRvZIPHw%253D%2540AAJTSQACMDE%253D%2523

How to tell sopaui do not encode url param again?
I am using sopaui4.
Thanks.
No RepliesBe the first to reply