Net::Am...Response(3)
π NAME π
ok so bestie, Net::Amazon::Response is the baseclass for all the responses you get back from Amazon's web service β¨
πΈ SYNOPSIS πΈ
$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";
}
}
like, that's the whole vibe check right there π«Ά
π¦ DESCRIPTION π¦
okay so Net::Amazon::Response is the baseclass for responses coming back from the useragent's request method. no cap.
and here's the tea β β responses are typically not of type Net::Amazon::Response, they're one of its subclasses Net::Amazon::Response::*. BUT, 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. it's giving mystery box π
β¨ METHODS β¨
is_success()β Returns true if the request was successful. and bestie, listen: this doesn't mean any objects have been found, it just indicates a successful roundtrip. so like, the trip was cute, doesn't mean the destination was πis_error()β Returns true if an error occurred. Usemessage()to determine what kind of error. because "something went wrong" is not the full story πproperties()β Returns the list ofNet::Amazon::Propertyobjects which were found by the query. the actual goods π₯as_string()β Dumps the content of the response. everything, all of it, spilled π«message()β Returns the error message as a string in case an error occurred. In case several errors occurred, they're stringed together. and if you need them separated? look upmessages(). iykyk πmessages()β Returns all error messages for a response as a reference to an array of string messages. organized queen energy β¨
π AUTHOR π
Mike Schilli, <m@perlmeister.com>
π COPYRIGHT AND LICENSE π
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.
okay that's the whole page bestie, go forth and handle your errors gracefully π
and a lil sign-off: this one's from the perl v5.42.0 era, dated 2025-07-25, chillin' in the User Contributed Perl Documentation section. slay πβ¨π¦
π¦ where this page comes from
- fedora 43: perl-Net-Amazon 0.62-35.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms