O'Reilly logo

Programming Amazon Web Services by James Murty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interacting with S3

REST API

The S3 web service application program interface (API) is made available through two interfaces: REST and SOAP. In this book we will use the REST interface.

The S3 service implementation presented in this chapter uses the REST API functionality in the AWS Ruby module. The AWS module includes methods, presented in REST API Implementation” in Chapter 2, that perform authentication, transmission, and response checking of REST API requests.

The REST API interface for the S3 service uses five HTTP methods to perform API operations: GET, HEAD, PUT, DELETE, and POST. The meaning of each method varies slightly, depending on what kind of S3 resource the operation is targeting: an object, a bucket, an Access Control List (ACL), or the S3 service itself. Table 3-1 lists some of the operations you can perform on S3 resources using different HTTP methods.

Table 3-1. Acting on S3 resources with HTTP methods

ResourceGETHEADPUTDELETEPOST
S3 ServiceList your buckets----
BucketList the bucket’s objects-Create the bucketDelete the bucket-
ObjectRetrieve the object’s data and metadataRetrieve the object’s metadataCreate or replace the objectDelete the objectCreate or replace the object
ACL (for a Bucket or Object resource)Retrieve ACL settings-Apply new ACL settings--

The most recent S3 API version available when this book was written, was 2006-03-01. This version number is used as a component of the XML namespace of documents provided to and produced by the service, http://s3.amazonaws.com/doc/2006-03-01/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required