I am having issues parsing the data I receive back from a Query for products in Google Product . If I run a query similar to...
curl --header "Authorization:GoogleLogin Auth=<AuthKey>" --header "Content-Type:application/atom+xml" https://content.googleapis.com/content/v1/8076653/items/products/generic?alt=json
This I receive a JSON(ish?) document, similar to the following
{
"version":"1.0",
"encoding":"UTF-8",
"feed":{
...
}
}
but when I run the following
res.on('end', function() {
console.log(res.body.feed);
mainRes.send(res.body);
});
The console shows undefined.
Should be...
res.on('end', function() {
console.log(JSON.parse(res.body).feed);
mainRes.send(res.body);
});