2012-07-16 2 views
0

Google 제품의 제품 검색어에서받은 데이터를 분석하는 데 문제가 있습니다. 나는 유사한 쿼리를 ... 실행하면Google API JSON 데이터를 특별히 소비하는 방법 Google 제품

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을받을이 다음

{ 
    "version":"1.0", 
    "encoding":"UTF-8", 
    "feed":{ 
    ... 
    } 
} 

유사 문서를 (? 틱)하지만 난 실행할 때 다음과 같은

res.on('end', function() { 
    console.log(res.body.feed); 
    mainRes.send(res.body); 
}); 

콘솔에 정의되지 않은 것으로 표시됩니다.

+0

'res.body'을 기록 시도하고 거기에서 구조를 해결 ...이어야한다 – Esailija

답변

0

res.on('end', function() { 
    console.log(JSON.parse(res.body).feed); 
    mainRes.send(res.body); 
});