我正在尝试查询Aazon MWS以获得ASIN的产品价格。但我无法在Google Apps脚本中转换查询,因此我可以使用UrlFetchApp。请帮忙。
http://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForASIN.html
答案 0 :(得分:0)
修改示例here以与您链接的AWS示例的一部分对齐:
function sendHttpPost() {
var payload =
{
"ASINList.ASIN.1" : "1933890517",
"AWSAccessKeyId" : "AKIAEXAMPLEFWR4TJ7ZQ",
"MWSAuthToken": "amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE"
// and so on for all of the name value pairs that make up the query
};
// Because payload is a JavaScript object, it will be interpreted as
// an HTML form. (We do not need to specify contentType; it will
// automatically default to either 'application/x-www-form-urlencoded'
// or 'multipart/form-data')
var options =
{
"method" : "post",
"payload" : payload
};
UrlFetchApp.fetch("http://example.com/upload_form.cgi", options);
}