Net::Am...Response(3)

πŸ“¦
version 0.62 Β· 2 versions
, in fedora 43

πŸ’– 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. Use message() to determine what kind of error. because "something went wrong" is not the full story 😭
  • properties() β€” Returns the list of Net::Amazon::Property objects 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 up messages(). 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 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