Build Status

NAME

Amazon::S3::Thin::ResponseParser - A parser for S3 XML responses

SYNOPSIS

use Amazon::S3::Thin;
use Amazon::S3::Thin::ResponseParser;

my $s3client = Amazon::S3::Thin->new({
    aws_access_key_id     => $aws_access_key_id,
    aws_secret_access_key => $aws_secret_access_key,
    region                => $region, # e.g. 'ap-northeast-1'
});

my $response_parser = Amazon::S3::Thin::ResponseParser->new();

my $res = $s3_client->list_objects($bucket);
die $res->status_line if $res->is_error;
my ($list_objects, $error) = $response_parser->list_objects($res->content);
die $error->{message} if $error;
# Print a list of the object keys in the bucket:
print join "\n", map { $_->{key} } @{$list_objects->{contents}};

DESCRIPTION

Amazon::S3::Thin::ResponseParser parses an XML response from S3 API.

This module provides a helper for the list_objects API which provide by Amazon::S3::Thin.

METHODS

SEE ALSO

Amazon::S3::Thin

LICENSE

Copyright (C) Takumi Akiyama.

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

AUTHOR

Takumi Akiyama t.akiym@gmail.com