ここの例に従っています
http://mcavage.github.com/node-restify/#JsonClient
次のように
var client = restify.createJsonClient({
url: 'http://api.stackoverflow.com'
});
client.get('/1.1/users/19068', function(err, req, res, obj) {
assert.ifError(err);
console.log('%j', obj);
});
次のエラー メッセージが表示されます
SyntaxError: Unexpected token
at Object.parse (native)
at /.../node_modules/restify/lib/clients/json_client.js:54:20
at IncomingMessage.<anonymous> (/.../node_modules/restify/lib/clients/string_client.js:149:16)
at IncomingMessage.g (events.js:156:14)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)
at Socket.ondata (http.js:1147:24)
at TCP.onread (net.js:354:27)