- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为 ItemSearch 使用 Amazon 文档中的一个简单示例,但出现了一个奇怪的错误:
“远程服务器返回了意外响应:(400) 错误请求。”
这是代码:
public static void Main()
{
//Remember to create an instance of the amazon service, including you Access ID.
AWSECommerceServicePortTypeClient service = new AWSECommerceServicePortTypeClient(new BasicHttpBinding(),
new EndpointAddress(
"http://webservices.amazon.com/onca/soap?Service=AWSECommerceService"));
AWSECommerceServicePortTypeClient client = new AWSECommerceServicePortTypeClient(
new BasicHttpBinding(),
new EndpointAddress("http://webservices.amazon.com/onca/soap?Service=AWSECommerceService"));
// prepare an ItemSearch request
ItemSearchRequest request = new ItemSearchRequest();
request.SearchIndex = "Books";
request.Title = "Harry+Potter";
request.ResponseGroup = new string[] { "Small" };
ItemSearch itemSearch = new ItemSearch();
itemSearch.Request = new ItemSearchRequest[] { request };
itemSearch.AWSAccessKeyId = accessKeyId;
// issue the ItemSearch request
try
{
ItemSearchResponse response = client.ItemSearch(itemSearch);
// write out the results
foreach (var item in response.Items[0].Item)
{
Console.WriteLine(item.ItemAttributes.Title);
}
}
catch(Exception e)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(e.Message);
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Press any key to quit...");
Clipboard.SetText(e.Message);
}
Console.ReadKey();
最佳答案
您收到此消息是因为您的请求未签名。从 2009 年 8 月开始,所有请求都必须签名。
您可以在此处查看有关如何签署亚马逊请求的示例:
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2480&categoryID=14
关于amazon-web-services - Amazon API ItemSearch 返回 (400) 错误请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2938591/
我花了一整天的时间尝试解决 Amazon ECS(电子商务服务)API 的问题。 我已经在他们的站点上下载了使用 .NET 4.0 和 WCF 发送 SOAP 请求的示例 http://aws.ama
我正在使用 PHP PEAR 亚马逊包从 API 检索产品,我现在可以搜索书籍和 DVD,但我需要所有类别,问题是我找不到所有类别,例如家庭和花园。 我正在使用以下代码提取书籍: $result =
我正在使用亚马逊产品广告 API,我想检索一个类别的所有产品。我想知道的是,我是否可以只提供一个类别,而不将任何关键字传递到 ItemSearch 操作中,并检索完整的产品记录集,包括它们的子类别产品
ItemSearch返回的DetailPageURL似乎包含错误的ID /标记,而不是我请求搜索的关联ID。 我越来越: http://www.amazon.co.uk/gp/product/15
我编写了以下代码: from hashlib import sha256 from base64 import b64encode import hmac import urllib from tim
我正在尝试从亚马逊产品广告 API 获取销售排名。我正在使用 amazon_product gem 。 request = AmazonProduct["us"] request.configure
ItemSearch 操作是否有像偏移这样的参数?我需要获取 100 多个结果,我不介意是否必须执行更多查询。 我使用的参数如下: 'Service' => "AWSECommerceService"
我正在为 ItemSearch 使用 Amazon 文档中的一个简单示例,但出现了一个奇怪的错误: “远程服务器返回了意外响应:(400) 错误请求。” 这是代码: public static voi
我正在尝试为亚马逊广告 API (http://pypi.python.org/pypi/python-amazon-product-api/) 使用 Python 包装器,但是当我尝试执行 Item
我正在尝试使用 Amazon Web Services 查询艺术家和标题信息并接收专辑封面。使用 C#,我找不到任何接近于此的示例。所有在线示例都已过时,不适用于 AWS 的较新版本。 最佳答案 Co
我是一名优秀的程序员,十分优秀!