Skip to main content
Anoosha Jogu preguntó en #Apex
Hi All,

am unable to do test coverage " Map<String,Object> jsonStub = (Map<String,Object>)JSON.deserializeUntyped(bodyResp); "  getting error as "System.JSONException: Illegal unquoted character ((CTRL-CHAR, code 13)): has to be escaped using backslash to be included in string value at [line:1, column:3254] " Can any one help me on this.

Thanks
4 respuestas
  1. 30 dic 2016, 07:39
    Hi Anu,

    You will have to trim off all the special characters in the response like this

     

    String replaceIllegal= res.getbody().replaceAll('\n','').replaceAll('\r','');

    Map<String,Object> responsemap = (Map<String,Object>)JSON.deserializeUntyped(replaceIllegal);

    Kindly mark it as an answer if that works !
0/9000