113
Views
3
Comments
Solved
How to send encoded url in JSON body request parameter?
Question

Hi,

Currently, I am consuming rest API and I have to pass an encoded url parameter to JSON body, but it is giving me below error:


Request  :     {  "ApplicatoinNumber": "string",  "JSONString": "<encoded url>" }


Error :   "Failed to parse JSON request content."


Then I tried to send decoded value which is in json format but stil it won't allow me to do and giving me the same error. 


So, any solution.

Regards,

Lovish 

UserImage.jpg
Lovish Goyal
Solution

I got the solution, I passed it in a single quotes '' and then used the decodeurl server action under HTML_Utils. 


Thanks for the comments

2019-07-01 07-16-04
Vinod Patidar

Hi Lovish,

Could you please share what actual value are you passing in "<encoded url>"?

Thanks

Vinod

2020-07-29 19-08-40
Sanjay Kumar Sahu

Hi Lovish,

Did you test your request in any API testing tool if it is working or not? First try with that, if that works, you can use EncodeURL() in OnBeforeRequest to encode your URL.


Sanjay

UserImage.jpg
Lovish Goyal
Solution

I got the solution, I passed it in a single quotes '' and then used the decodeurl server action under HTML_Utils. 


Thanks for the comments

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.