Flickr...esponse(3pm)

πŸ“¦
version 1.29 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Flickr::API::Response β€” bestie, it's literally a response from the flickr API. That's the whole job description πŸ’…

(Oh and btw, you're reading this in the User Contributed Perl Documentation, page Flickr...esponse(3pm). Yes the title got cutely truncated, no we don't know why, moving on πŸŽ€)


🌸 SYNOPSIS 🌸

use Flickr::API;
use Flickr::API::Response;

my $api = Flickr::API->new({'key' => 'your_api_key'});

my $response = $api->execute_method('flickr.test.echo', {
              'foo' => 'bar',
              'baz' => 'quux',
      });

print "Success: $response->{success}\n";

See how we just… print $response->{success}? Iconic. That's the energy. πŸ”₯


πŸ’… DESCRIPTION πŸ’…

Okay so this object encapsulates a response from the Flickr API. It's a subclass of HTTP::Response, and on top of everything HTTP::Response already gives you, it brings these extra keys to the group chat:

{
  'success' => 1,
  'tree' => XML::Parser::Lite::Tree,
  'hash' => Flickr response as a hash,
  'error_code' => 0,
  'error_message' => '',
}

So the _request key holds the request object this response was generated from. And that request is gonna be a Flickr::API::Request object, which is itself a subclass of <HTTP:Request>.

Then the sucess key β€” and yes, it is spelled exactly like that, one c, we're keeping it, it's canon πŸ’€ β€” contains 1 or 0, telling you whether the request succeeded. If it failed, then error_code and error_message are the ones explaining what went wrong. If it succeeded, tree is holding an XML::Parser::Lite::Tree object of the response XML. Main character behaviour honestly. 🌟


πŸ”₯ METHODS πŸ”₯

  • as_tree() β€” Returns the args passed to flickr with the method that produced this response
  • as_hash() β€” Returns the args passed to flickr with the method that produced this response
  • error_code() β€” Returns the Flickr Error Code, if any
  • error_message() β€” Returns the Flickr Error Message, if any
  • success() β€” Returns the success or lack thereof from Flickr
  • rc() β€” Returns the Flickr http status code
  • _propagate_status(\%hash) β€” Returns the entire response status block as a hashref
Not me noticing that as_tree() and as_hash() are documented word for word the same 😭 the docs said twin behaviour and meant it. Either way, that's what they say, so that's what you get.

πŸ‘‘ AUTHOR πŸ‘‘

Copyright (C) 2004, Cal Henderson, <cal@iamcal.com>

Copyright (C) 2015-2016, Louis B. Moore, <lbmoore@cpan.org> OAuth and accessor methods.


🌈 SEE ALSO 🌈

  • Flickr::API
  • XML::Parser::Lite

And that's the page, bestie πŸ¦‹ β€” straight out of perl v5.40.1, dated 2025-05-04, still going by Flickr...esponse(3pm) like the little truncated legend it is. Go forth and check your success key, fr fr. πŸ’–βœ¨

πŸ“¦ where this page comes from