I'm getting an `Unterminated string literal ` erro...
# suitescript
j
I'm getting an
Unterminated string literal
error when trying to POST to a RESTlet, I assume it's an issue with the contents of the request but has anyone encountered this before?
j
If you're parsing data you can run a replace to get rid of carriage returns first.
Copy code
JSON.parse(JSON.stringify(data).replace(/\\n/g,'').replace(/\\r/g,''))
j
Thanks for the link, looks like it could be the issue! I encounter it as soon as I log the request body so happens before I even try and parse.