# phpman > perldoc > Flickr::API::Response

## NAME
    [Flickr::API::Response](https://www.chedong.com/phpMan.php/perldoc/Flickr%3A%3AAPI%3A%3AResponse/markdown) - A response from the flickr API.

## SYNOPSIS
      use [Flickr::API](https://www.chedong.com/phpMan.php/perldoc/Flickr%3A%3AAPI/markdown);
      use [Flickr::API::Response](https://www.chedong.com/phpMan.php/perldoc/Flickr%3A%3AAPI%3A%3AResponse/markdown);

      my $api = [Flickr::API](https://www.chedong.com/phpMan.php/perldoc/Flickr%3A%3AAPI/markdown)->new({'key' => 'your_api_key'});

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

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

## DESCRIPTION
    This object encapsulates a response from the Flickr API. It's a subclass of [HTTP::Response](https://www.chedong.com/phpMan.php/perldoc/HTTP%3A%3AResponse/markdown) with
    the following additional keys:

      {
        'success' => 1,
        'tree' => [XML::Parser::Lite::Tree](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AParser%3A%3ALite%3A%3ATree/markdown),
        'hash' => Flickr response as a hash,
        'error_code' => 0,
        'error_message' => '',
      }

    The "_request" key contains the request object that this response was generated from. This
    request will be a [Flickr::API::Request](https://www.chedong.com/phpMan.php/perldoc/Flickr%3A%3AAPI%3A%3ARequest/markdown) object, which is a subclass of <HTTP:Request>.

    The "sucess" key contains 1 or 0, indicating whether the request succeeded. If it failed,
    "error_code" and "error_message" explain what went wrong. If it succeeded, "tree" contains an
    [XML::Parser::Lite::Tree](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AParser%3A%3ALite%3A%3ATree/markdown) object of the response XML.

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

## 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](https://www.chedong.com/phpMan.php/perldoc/Flickr%3A%3AAPI/markdown), [XML::Parser::Lite](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AParser%3A%3ALite/markdown)

