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


Thanks to Ruben on the support team for the help!



The above is the solution. :)