For ex if I have json as:
{"attributes": {"first_name":"A","last_name":"c","email":"te@gmail.com","Id":"003S000000vz81JIAQ"}}
then how can I convert this into application/x-www-form-urlencoded format in Apex.
like this:
'id=5&first_name=a&last_name=c&email=te@gmail.com'
I have tried with EncodingUtil.urlEncode(String,'UTF-8'); method but its not converting into that format.
Best Answer
As mentioned in comment, you have to deserialize the JSON and create the EncodeURL string from it.