Hey all - I'm sending a POST request to a NetSuite...
# suitescript
t
Hey all - I'm sending a POST request to a NetSuite suitelet. When trying to JSON.parse() the context.request.body, I get this error message from NetSuite: "type":"error.SuiteScriptError","name":"SyntaxError","message":"Unexpected token in object literal". However, when I run the JSON through a JSON validator, there are no issues. Any ideas what could be causing this?
b
probably not, you can try logging what context.request.body and check that its value matches what you validated against
you can try sharing the context.request.body to see if others can see issues
if its sensitive data, then try pruning the data in the object until you find what is causing the problem
t
I'm running the context.request.body JSON through jsonlint.com and it comes back as valid. Is it still possible there's an error in the JSON even if jsonlint.com is showing it's valid?
b
If im guessing with no context, then its non ascii characters or html in the json