【发布时间】:2012-07-16 19:29:20
【问题描述】:
我在解析从 Query for products in Google Product 收到的数据时遇到问题。如果我运行类似于...的查询...
curl --header "Authorization:GoogleLogin Auth=<AuthKey>" --header "Content-Type:application/atom+xml" https://content.googleapis.com/content/v1/8076653/items/products/generic?alt=json
我收到一个 JSON(ish?) 文档,类似于以下内容
{
"version":"1.0",
"encoding":"UTF-8",
"feed":{
...
}
}
但是当我运行以下命令时
res.on('end', function() {
console.log(res.body.feed);
mainRes.send(res.body);
});
控制台显示未定义。
【问题讨论】:
-
尝试记录
res.body并从那里计算出结构
标签: node.js google-api