【发布时间】:2013-03-13 21:55:26
【问题描述】:
我需要快速的应用程序,因此我想在响应中准确指定我想要的内容,而不是在其中包含大量多余的信息。我知道ResponseGroups,但没有一个组可以限制我返回的信息。如果您查看my current implementation,它会发回大量与我正在寻找的产品无关的信息。真正的问题是它只是笨重。
有没有办法为每个产品指定非常具体的内容?例如:
- 格式化价格
- 姓名
- 链接
- 图片
- 说明
我什么都不在乎。
注意:我使用Node-APAC 来处理对亚马逊产品API 的请求。所以它为我将响应 XML 转换为 JSON。
这是我得到的(大部分):
{
ItemSearchResponse: {
$: {...},
OperationRequest: [...],
Items: [
{
Request: [...],
TotalResults: [...],
TotalPages: [...],
MoreSearchResultsUrl: [...],
Item: [
{
ASIN: [...],
DetailPageURL: [...],
ItemLinks: [...],
SmallImage: [...],
MediumImage: [...],
LargeImage: [...],
ImageSets: [...],
ItemAttributes: [...],
OfferSummary: [...]
},
{...},
{...},
{...},
{...}
]
}
]
}
}
我想得到的是:
[
{
FormattedPrice: 12.99,
Name: "The Hitchhiker's Guide to the Galaxy"
Link: "http://www.amazon.com/Hitchhikers-Guide-Galaxy-Douglas-Adams/dp/0345391802"
Image: "http://g-ecx.images-amazon.com/images/G/01/ciu/eb/05/0663124128a0de9c79891010.L._AA300_.jpg"
Description: "<Book-Description>"
},
{...},
{...}
]
【问题讨论】:
标签: api node.js amazon-web-services amazon amazon-product-api