Closed ianlin0126 closed 10 years ago
i can't see a problem
response = @client.search Keywords: 'apple', SearchIndex: :UnboxVideo
response.first.asin # => B003V2MC78
I tried debugging this and found in client.rb 255 the HTTPI.get(url) seems to be causing trouble for me: HTTPI GET request to webservices.amazon.com (excon)
=> #<HTTPI::Response:0x007f93c6089a38 @code=403, @headers={"Date"=>"Sat, 26 Jul 2014 17:14:21 GMT", "Server"=>"Server", "Vary"=>"Accept-Encoding,User-Agent", "Connection"=>"close", "Transfer-Encoding"=>"", "Content-Type"=>"text/plain"}, @raw_body="<?xml version=\"1.0\"?>\n<ItemLookupErrorResponse xmlns=\"http://ecs.amazonaws.com/doc/2011-08-01/\"><Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</Message></Error><RequestId>d13e229f-5561-4807-9dae-00d11331735f</RequestId></ItemLookupErrorResponse>">
My httpi is v2.2.4, not sure if this is the problem.
However, if I use HTTParty it doesn't throw the same error. Was wondering if this occurs to you as well?
I seem to be getting the proper response with HTTPI from what I can tell
response = @client.search Keywords: 'apple', SearchIndex: :UnboxVideo
DEBUG -- : calling with params={:Keywords=>"apple", :SearchIndex=>:UnboxVideo, :Operation=>:ItemSearch}
DEBUG -- : HTTPI GET request to webservices.amazon.com (httpclient)
DEBUG -- : got response='<?xml version="1.0" ?> #etc...
# ...
response.first.asin
=> "B003V2MC78"
Here's my version of httpi
gem list | grep httpi
httpi (2.0.0, 1.1.1)
Thanks guys! I think it's the newer version of httpi causing problem. Using 2.0.0 works for me too
No problemo :smiley: :+1:
This is not fixed. I can't install httpi v2.0.0; so now i can't use this gem.
@Merovex it's running with httpi 2.3.0 as well. is that an option for you?
I fixed the ability to install the httpi:2.0.0 gem. But, I get a 403 error via the gem...but the URL works fine in the browser.
I just forced the gem (see below) and it works fine. The default httpi gem is 2.3.0, I also have 2.1.0 installed. So, I submit it does not work with 2.3.0.
require 'rubygems' gem 'httpi', "2.0.0" require 'asin'
@Merovex what ruby version are you running on?
ruby-2.0.0-p481, but I don't see anything that suggests a conflict b/w httpi and that version.
On Wed, Dec 17, 2014 at 11:04 AM, Peter Schröder notifications@github.com wrote:
@Merovex https://github.com/Merovex what ruby version are you running on?
— Reply to this email directly or view it on GitHub https://github.com/phoet/asin/issues/39#issuecomment-67344457.
Ben Wilson "A belief, no matter how sincere, if not reflected in reality isn’t a belief; it’s a delusion."
If you're looking for a quick fix, you can "gem 'curb'" in your Gemfile and "skip over" trying to resolve the problem with HTTPI (I also had the above).
i can't find anything in HTTPI that would have any influence on this. my assumption is that some HTTP library changed the way it treats parameters (or whitespace) and thus there is a malformed signature.
if you can provide any further information post it here.
this is the amazon troubleshooting guide, just in case...
I'm using the asin gem (https://github.com/phoet/asin) to make requests to Amazon Product API.
It has been working well for a whole year but a few days ago without making any changes I started noticing the same product API requests now return the following error:
The original request still works, so I'm assuming that some changes on Amazon product API made the asin gem incompatible: