GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::Amazon::Response(3) User Contributed Perl Documentation Net::Amazon::Response(3)

Net::Amazon::Response - Baseclass for responses from Amazon's web service

    $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";
        }
    }

"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.

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.

Mike Schilli, <m@perlmeister.com>

Copyright 2003 by Mike Schilli <m@perlmeister.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2009-09-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.