amazonaws.com)
A bucket resource supports the following three methods:
PUT bucket
Creates a bucket with the given name (as the client gets to choose the name,
this is accomplished with PUT to the resource itself, rather than POST to the
parent). Attempting to create a bucket that already exists will return an
HTTP 409 Conflict error code.
GET bucket
Retrieves a list of objects contained in the specified bucket. Takes a prefix
parameter in the query string to list all keys that begin with a given string.
234 | Chapter 7: REST, Resources, and Web Services
DELETE bucket
Deletes the specified bucket. Only the bucket??™s owner may delete a bucket.
A bucket can be deleted only if it is empty; attempting to delete a nonempty
bucket will cause an error with an HTTP status code of 409 Conflict.
Object
Represents an object stored within a bucket. Accessible at the following URIs:
??? http://s3.amazonaws.com/bucketkey/objectkey
??? http://bucketkey.s3.amazonaws.com/objectkey
??? http://bucketkey/objectkey
All object keys, as seen above, are qualified with their bucket key. An object
resource supports the following four methods:
PUT object
Stores the given data at the location specified, creating a new object or overwriting
an existing object.
GET object
Retrieves and returns the object at the specified location.
HEAD object
Returns the headers that would be returned from a GET request on this
object, with no body.
Pages:
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366