function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

special character & creates problem

Hello,

I am sending a request, the body has special character & .
when the server on other side received it, it deletes the json after & and rending it invalid.

How can I replace the & but still keep it as it it
request.setBody(body);
HttpResponse response = http.send(request);
thank you for suggestion
 
Best Answer chosen by Ab
SwethaSwetha (Salesforce Developers) 
HI Sandrine,
Your scenario looks simiar to https://salesforce.stackexchange.com/questions/195515/refrain-from-unescaping-special-characters-when-receiving-restcontext-json

Can you check how the payload is being sent?

Also see related : https://salesforce.stackexchange.com/questions/327651/special-characters-in-rest-api-url

If this information helps, please mark the answer as best. Thank you