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 

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

Hi Lovish,

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

Thanks

Vinod

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

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.