GetObject
is the basic operation for retrieving an object stored in Amazon S3. If you want a few more bells and whistles, check out GetObjectExtended.
Example
Get the "Nelson" object from the "quotes" bucket:
Sample Request
<GetObject xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Bucket>quotes</Bucket> <Key>Nelson</Key> <GetMetadata>true</GetMetadata> <GetData>true</GetData> <InlineData>true</InlineData> <AWSAccessKeyId>1D9FVRAYCP1VJS767E02</AWSAccessKeyId> <Timestamp>2005-01-31T23:59:59.183Z</Timestamp> <Signature>Iuyz3d3P0aTou39dzbq7RrtSFmw=</Signature> </GetObject>
Sample Response
<GetObjectResponse xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <GetObjectResponse> <Status> <Code>200</Code> <Description>OK</Description> </Status> <Metadata> <Name>Content-Type</Name> <Value>text/plain</Value> </Metadata> <Metadata> <Name>family</Name> <Value>Muntz</Value> </Metadata> <Data>aGEtaGE=</Data> <LastModified>2005-11-18T01:25:07.994Z</LastModified> <ETag>"828ef3fdfa96f00ad9f27c383fc9ac7f"</ETag> </GetObjectResponse> </GetObjectResponse>
Bucket: The bucket from which to retrieve the object.
Key: The key that identifies the object.
GetMetadata: The metadata is returned with the object if this is true.
GetData: The object data is returned if this is true.
InlineData: If this is true, then the data is returned, base 64-encoded, as part of the SOAP body of the response. If false, then the data is returned as a SOAP attachment.
Metadata: The name-value paired metadata stored with the object.
Data: If InlineData was true in the request, this contains the base 64 encoded object data.
LastModified: The time that the object was stored in Amazon S3.
ETag: The object's entity tag. This is a hash of the object that can be used to do conditional gets.
You can read an object only if you have been granted READ
access to the object.