createJsonClient to post my data to a restify server like
console.log(typeof payload); // string
payload = JSON.parse(payload).Body;
console.log(payload); //object
client.post('/sqs', payload, function (err, req, res, obj) {
if (err)
callback(err, null);
else {
console.log(obj);
}
});
But I'm getting
{ [InternalError: Unexpected token o]\n message: 'Unexpected token o',\n statusCode: 500,\n body: { code: 'InternalError', message: 'Unexpected token o' },\n restCode: 'InternalError',\n name: 'InternalError' }
The payload is a valid JSON object after JSON.parse, How do post an object in restify.createJsonClient ?