Closed joelabair closed 7 years ago
Hi. I'm not getting the error. What version of node.js are you using?
v4.8.4
I first ran it with v6.11.2 and it worked. I also ran it with v4.8.4 and it also worked. I am using v2.1.2 of node-sparkpost.
Ok - I'll try to isolate the environment more.
Yeah. Maybe include a stack trace. Just let us know what you figure out.
My Bad. I was parsing res elsewhere in the code and the key 'body' is undefined. JSON.parse(res.body)
Obviously a change in the 2.1.x series.
Sorry for the fire alarm. Thanks for your help.
Glad you were able to track it down. That was a change from 1.x to 2.x, the second argument is the data from the request. So it is res.body.
The error returned is 'SyntaxError: Unexpected token u' When using the callback method.