Net::Amazon::Response(3pm)

Net::Amazon::Response3pm

Baseclass for responses from amazon's web service

Usage

    $resp = $ua->request($request);
    if($resp->is_success()) { 
        print $resp->as_string();
    }
    if($resp->is_error()) {
        print $resp->message();
    }
    if($resp->is_success()) { 
        for my $property ($resp->properties) {
            print $property->as_string(), "\n";
        }
    }

Overview

"Net::Amazon::Response" is the baseclass for responses coming back from the useragent's "request" method. Responses are typically not of type "Net::Amazon::Response" but one of its subclasses "Net::Amazon::Response::*". However, for basic error handling and dumping content, "Net::Amazon::Response"'s methods are typically used, because we typically don't know what type of object we're actually dealing with.

Methods

is_success()

Returns true if the request was successful. This doesn't mean any objects have been found, it just indicates a successful roundtrip.

is_error()

Returns true if an error occurred. Use "message()" to determine what kind of error.

properties()

Returns the list of "Net::Amazon::Property" objects which were found by the query.

as_string()

Dumps the content of the response.

message()

Returns the error message as a string in case an error occurred. In case several errors occurred, they're stringed together. Look up "messages()" if you need them separated.

messages()

Returns all error messages for a response as a reference to an array of string messages.

Releases

6 releases since Debian 4.0 (Etch); the text changed 5 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9

Author

Mike Schilli, <[email protected]>

From libnet-amazon-perl 0.62-2 in Debian 9 (Stretch). Parsed by carta from the page's man source.