JSON.parse() not working

I dont think you should call JSON.parse(jsonObject) if the server is sending valid JSON as it will be parsed automatically when it retrieves the response. I believe that if You set the Content-type: application/json header it will be parsed automatically.

Try using jsonObject as if it was already parsed, something like:

console.log(jsonObject.canApprove);

Without calling JSON.parse before.

Leave a Comment