Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Net::Amazon::S3::Response

Name Net::Amazon::S3::Response
Version 0.991
Located at /usr/share/perl5/vendor_perl
File /usr/share/perl5/vendor_perl/Net/Amazon/S3/Response.pm
Is Core No
Search CPAN for this module Net::Amazon::S3::Response
Documentation Net::Amazon::S3::Response
Module Details Net::Amazon::S3::Response


NAME

Net::Amazon::S3::Response - Behaviour common to most S3 responses.


VERSION

version 0.991


SYNOPSIS

        package Command::Response;
        extends 'Net::Amazon::S3::Response';
        ...
        my $response = Command::Response->new (
                http_response => $http_response,
        );


DESCRIPTION

Response handler base class providing functionality common to most S3 responses.


EXTENDING

the Net::Amazon::S3::Response manpage provides methods to cache response data.

_data
Read-only accessor initialized by _build_data

_build_data
Data builder, by default calls _parse_data if response is success and provides valid XML document.

_parse_data
Abstract (undefined in parent) method to be implemented by children.


METHODS

Constructor

Constructor accepts only one (required) parameter - http_response. It should act like the HTTP::Response manpage.

Response classification methods

is_success
True if response is a success response, false otherwise.

Successful response may contain invalid XML.

is_redirect
True if response is a redirect.

is_error
True if response is an error response, false otherwise.

Response is considered to be an error either when response code is an HTTP error (4xx or 5xx) or response content is an error XML document.

See also ``S3 Error Response'' for more details.

is_internal_response
True if response is generated by user agent itself (eg: Cannot connect)

is_xml_content
True if response data is a valid XML document

Error handling

Apart error classifition the Net::Amazon::S3::Response manpage provides also common error data accessors.

Error data are available only in case of error response.

error_code
Either content of Error/Code XML element or HTTP response code.

error_message
Either content of Error/Message XML element or HTTP response message.

error_request_id
Content of Error/RequestId XML element if available, x-amz-request-id header if available, empty list otherwise.

error_resource
Content of c<Error/Resource> if available, request uri otherwise.

Common Response Headers

See ``S3 Common Response Headers'' for more details.

content_length
content_type
connection
etag
ETag with trimmed leading/trailing quotes.

server
delete_marker
request_id
id_2
version_id

XML Document parsing

xml_document
Lazy built instance of the XML::LibXML manpage.

Available only if response is XML response and contains valid XML document.

xpath_context
Lazy built instance of the XML::LibXML::XPathContext manpage.

Available only if response is XML response and contains valid XML document

HTTP Response methods

Further methods delegated to http_response. Refer the HTTP::Response manpage for description.

code
message
status_line
content
decoded_content
header
headers
header_field_names


AUTHOR

Branislav Zahradník <barney@cpan.org>


COPYRIGHT AND LICENSE

This module is part of the Net::Amazon::S3 manpage.


AUTHOR

Branislav Zahradník <barney@cpan.org>


COPYRIGHT AND LICENSE

This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.

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

Perl Diver brought to you by ScriptSolutions.com © 1997- 2025