REST fails to parse JSON response

REST fails to parse JSON response

  

Struggled with this, and needed an assist from support, so I figurd I'd share...


Kept getting this error:

Unexpected character encountered while parsing value: ?. Path '', line 0, position 0


Most useless message in the world. JSON looked fine. I turned on full logging, created an "OnAfterResponse" and copy/pasted the contents of the response into CustomizedResponse.Response.Text and it worked fine. Huh?


Turns out there was some extended ASCII characters in there. Yikes. Used this RegEx to strip them out in the OnAfterResponse and now it works fine.

SyntaxEditor Code Snippet

Regex_Replace(Response.ResponseText,"[^\x00-\x7F]","",IgnoreCase:,MultiLine:,SingleLine:)


Thanks to Ruben on the support team for the help!

J.Ja

Solution

The above is the solution. :)


J.Ja

Solution