Naton Aiman-Smith > Net-Amazon-AWSSign > Net::Amazon::AWSSign

Download:
Net-Amazon-AWSSign-0.12.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.12   Source  

NAME ^

Net::Amazon::AWSSign - Perl extension to create signatures for AWS requests

SYNOPSIS ^

  use Net::Amazon::AWSSign;
  my $awsKey="AWS_Access_Key";  # Get this from AWS if you don't already have one
  my $awsSecret="AWS_Secret_Key";  # Get this from AWS if you don't already have one
  my $awsSign=new Net::Amazon::AWSSign("$awsKey", "$awsSecret");  # New object
  # SOAP
  my $awsSOAPAction=ItemSearch;
  my ($SOAPTimestamp, $SOAPSignature)=$awsSign->SOAPSig($awsSOAPAction);
  # REST
  my $awsASIN='B000002U82';   # Dark Side of the Moon
  my $awsRESTURI="http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemLookup&ItemId=$awsASIN&ResponseGroup=Medium"; # Simple lookup
  my $awsSignedRESTURI=$awsSign->addRESTSecret($awsRESTURI);  # Returns signed REST query URI for lwp-get, curl, etc.

DESCRIPTION ^

This module can be used to sign requests for most Amazon AWS services. While this is designed for simple lookups, it should work for pretty much any service (i.e. EC2), since the signing method is the same for all Amazon services. If you want to write your own program to use an Amazon API, this module might save you some time. Or, feel free to paste it into your own modules as long as you follow the license requirements.

As for available methods, the synopsis / example pretty much says it all. But, in the interest of full documentation...

METHODS

SPECIAL CHARACTERS

If you need to insert special characters (most commonly '&') in your query string then you should escape them beforehand. For example:

  my $awsRESTURI="http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemSearch&SearchIndex=Books&Condition=All&Keywords=Heckle%26Jeckle";

SEE ALSO ^

Net::Amazon::Signature - if AWSSign doesn't meet your needs, then maybe this will.

AUTHOR ^

Naton Aiman-Smith, <naton@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2009 by Naton Aiman-Smith

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: