gpt4 book ai didi

c# - AMAZON Api 认证错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:52:59 26 4
gpt4 key购买 nike

尝试使用亚马逊API获取商品数据,目前惨遭失败。

出现以下错误:(客户端身份验证方案“匿名”禁止 HTTP 请求。)

有人愿意为我指出正确的方向或提供指向 API 用法的良好示例的链接吗?

Dim itemRequest As New ItemSearchRequest

With itemRequest
.Keywords = "Matrix"
.SearchIndex = "DVD"
.ResponseGroup = New String() {"Images"}
End With

Dim request As New ItemSearch
request.AWSAccessKeyId = _AWSAccessKeyId
request.Request = New ItemSearchRequest() {itemRequest}

Dim binding As New BasicHttpBinding(BasicHttpSecurityMode.Transport)
binding.MaxReceivedMessageSize = Integer.MaxValue

Dim serviceProvider As New AWS_Services.AWSECommerceServicePortTypeClient(binding, New EndpointAddress("https://webservices.amazon.com/onca/soap?Service=AWSECommerceService"))


serviceProvider.ChannelFactory.Endpoint.Behaviors.Add(New AmazonSigningEndpointBehavior(_AssociateTag, _AWSAccessKeyId))

Dim response As ItemSearchResponse = serviceProvider.ItemSearch(request)

最佳答案

原来我使用了不正确的 _AssociateTag、_AWSAccessKeyId 组合。代码中的其他所有内容都是正确的...

关于c# - AMAZON Api 认证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3278158/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com