[SalesForce] Pass json string in url

I have a url like

I want to apend json string like this custom_info={'incrf':'aa'}

How can I achieve this?

Best Answer

This is JSON (note the double not single quotes):


To ensure that no characters that have special meaning in a URL are included, put the JSON String through EncodingUtil.urlEncode when you add it to the URL and through EncodingUtil.urlDecode when you take it out of the URL.

The above JSON encodes to:


This approach is best used with quite short JSON (a few hundred characters) as maximum URL length limits across the internet are somewhat unpredictable.

Related Topic