A resource is fetched in node.js like this:
requestify.post('myurl')
.then(function (response) {
console.log(response);
console.log(response.body);
});
console.log(response) gives:
Response {
code: 200,
body: '{"guid":"abcd","nounce":"efgh"}'
}
console.log(response.body) gives:
{"guid":"abcd","nounce":"efgh"}
However, for some reason I cannot access the key "guid" or "nounce". In both cases I get an undefined. I have tried both with
console.log(response.body.guid);
and
console.log(response.body['guid']);