PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » Services_Amazon » Bug #8527

Using locale 'de' does not work - HTTP Status 302 not supported

Details

Request #8527Using locale 'de' does not work - HTTP Status 302 not supported
Submitted2006-08-21 17:30 UTC
Fromopenhaus at php dot net
Assignedttsuruoka
StatusClosed
PackageServices_Amazon
PHP Version5.1.4
OSLinux
Roadmaps(Not assigned)

Comments

[2006-08-21 17:30 UTC] openhaus at php dot net

Description:
------------
IF I issue a simple request as shown in the field "test script" with the locale 'de' set, I get an error because the request is redirected on the server side but the PEAR script excepts the HTTP status code 200.

// Retrieve the result and check that its HTTP 200 Ok. Otherwise raise
// an error.
if ($http->getResponseCode() != 200) {
return PEAR::raiseError('Amazon return HTTP ' . $http->getResponseCode());
}

line 774, Amazon.php

Would be great if you could add more response codes.

Thank you,
Fabio.

Test script:
---------------
require_once 'Services/Amazon.php';

class PhpAmazon
{
private $amazon;

function __construct()
{
$this->amazon = new Services_Amazon('XXX', 'php-dsaa', 'de');
}

public function getAmazon()
{
return $this->amazon;
}
}

$phpAmazon = new PhpAmazon();
$products = $phpAmazon->getAmazon()->searchKeyword('PHP');

if(!PEAR::isError($products))
{
var_dump($products);
}
else
{
echo $products->message;
}

Expected result:
----------------

array(7) {
[0]=>
array(12) {
["url"]=> ...

Actual result:
--------------
Amazon return HTTP 302

[2006-11-04 08:07 UTC] s dot newslists at googlemail dot com

I also was stoped by this bug. Are there any solutions until now?
Look here:
http://raa.ruby-lang.org/project/ruby-amazon/
under "Changes in 0.9.1: ". They had the same problems. Perhaps it helps.

[2006-11-04 15:28 UTC] ttsuruoka at php dot net

This has been fixed in the latest released version (0.7.0).

Thank you for reporting!