question

amichaels avatar image
amichaels asked amichaels commented

iTest ReST session and non urlencoded query string

Hi! I am using the rest session and I want to pass the query string as a variable to a POST command. The query string I have is not URL encoded. As a result, the session pushes the non URL-encoded data to the server, which results in a null result from the server. If I replace the variable with the URL-encoded version of the query string, the POST operation completes normally. Is there a way to urlencode the string? I know that TCLLIB has a ncgi package that has a command to do this, but is there a way to do this in iTest?
iTestautomationiTest Enterprisehttprest
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
vijaykumar avatar image
vijaykumar answered amichaels commented
If my understanding is correct you want to encode the url before using it in the REST session. We can achieve this by using some online url encoding tools say ( http://meyerweb.com/eric/tools/dencoder/). I have followed the below process: 1. Created Web session profile 2. Encoded the url using online tool 3. Stored that encoded url value in a variable(url) 4. Passed the variable to REST session ![alt text][1] [1]: /storage/temp/4127-encode.png

encode.png (41.9 KiB)
1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amichaels avatar image amichaels ♦ commented ·
Yes, you understand what I want correctly. However, it seems odd that I'd need to urlencode the query strings in this fashion. Since the session will urlemcode query strings that I enter into it, I hoped that the session would do so for query strings passed in through a variable.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.