You need to sign in to do that
Don't have an account?
Shalini Garg 13
Remove back slash from response
Remove back slash in response json through rest API in workbench post method in salesforce
Eg:- "[{\"Result\":\"No Data Found\",\"RequestType\":\"Delete\",\"RequestID\":\"YPN\"}]"
We want to delete the \ from above json.
Eg:- "[{\"Result\":\"No Data Found\",\"RequestType\":\"Delete\",\"RequestID\":\"YPN\"}]"
We want to delete the \ from above json.
Try like below :
Thanks,
Maharajan.C
through rest API in workbench post please help from that link:-
https://developer.salesforce.com/forums/?id=906F0000000fxruIAA
Please mark it as the best answer if it helps you to fix the issue.
Thank you!
Regards,
Suraj Tripathi
I am getting this error in json response in workbench which i am returning from Apex not getting in debug log Salesforce Apex class
Raw Response
HTTP/1.1 200 OK Date: Thu, 20 May 2021 13:38:44 GMT Strict-Transport-Security: max-age=31536000; includeSubDomains X-Robots-Tag: none Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private Set-Cookie: BrowserId=skBb07lwEeuPNAm_YzkTXA; domain=.salesforce.com; path=/; expires=Fri, 20-May-2022 13:38:44 GMT; Max-Age=31536000 Set-Cookie: BrowserId_sec=skBb07lwEeuPNAm_YzkTXA; domain=.salesforce.com; path=/; expires=Fri, 20-May-2022 13:38:44 GMT; Max-Age=31536000; secure; SameSite=None Content-Type: application/json;charset=UTF-8 Vary: Accept-Encoding Content-Encoding: gzip Transfer-Encoding: chunked
"[{\"Result\":\"No Data Found\",\"RequestType\":\"Delete\",\"RequestID\":\"YPNEE5Y7R5S\"}]"
I'd recommend trying the approach mentioned in https://salesforce.stackexchange.com/questions/213989/jsongenerator-issue
To remove the backslash you have to write the blob value of the JSON String into the body directly in the RestContext. You will have to change the return type of your method from String to void.
Also see Related: https://salesforce.stackexchange.com/questions/221062/jsongenerator-writeobjectfield-remove-backslashes
If this information helps, please mark the answer as best. Thank you
@swetha
This worked great for me! Just implemented and all fixed.