Retrieves objects from Amazon S3. To use GET
, you must have READ
\n * access to the object. If you grant READ
access to the anonymous user, you can\n * return the object without using an authorization header.
An Amazon S3 bucket has no directory hierarchy such as you would find in a typical computer\n * file system. You can, however, create a logical hierarchy by using object key names that\n * imply a folder structure. For example, instead of naming an object sample.jpg
,\n * you can name it photos/2006/February/sample.jpg
.
To get an object from such a logical hierarchy, specify the full key name for the object\n * in the GET
operation. For a virtual hosted-style request example, if you have\n * the object photos/2006/February/sample.jpg
, specify the resource as\n * /photos/2006/February/sample.jpg
. For a path-style request example, if you\n * have the object photos/2006/February/sample.jpg
in the bucket named\n * examplebucket
, specify the resource as\n * /examplebucket/photos/2006/February/sample.jpg
. For more information about\n * request types, see HTTP Host Header Bucket Specification.
To distribute large files to many people, you can save bandwidth costs by using\n * BitTorrent. For more information, see Amazon S3\n * Torrent. For more information about returning the ACL of an object, see GetObjectAcl.
\n *\n *If the object you are retrieving is stored in the S3 Glacier or\n * S3 Glacier Deep Archive storage class, or S3 Intelligent-Tiering Archive or\n * S3 Intelligent-Tiering Deep Archive tiers, before you can retrieve the object you must first restore a\n * copy using RestoreObject. Otherwise, this operation returns an\n * InvalidObjectStateError
error. For information about restoring archived\n * objects, see Restoring Archived\n * Objects.
Encryption request headers, like x-amz-server-side-encryption
, should not\n * be sent for GET requests if your object uses server-side encryption with CMKs stored in AWS\n * KMS (SSE-KMS) or server-side encryption with Amazon S3–managed encryption keys (SSE-S3). If your\n * object does use these types of keys, you’ll get an HTTP 400 BadRequest error.
If you encrypt an object by using server-side encryption with customer-provided\n * encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object,\n * you must use the following headers:
\n *x-amz-server-side-encryption-customer-algorithm
\n *x-amz-server-side-encryption-customer-key
\n *x-amz-server-side-encryption-customer-key-MD5
\n *For more information about SSE-C, see Server-Side Encryption (Using\n * Customer-Provided Encryption Keys).
\n *\n *Assuming you have permission to read object tags (permission for the\n * s3:GetObjectVersionTagging
action), the response also returns the\n * x-amz-tagging-count
header that provides the count of number of tags\n * associated with the object. You can use GetObjectTagging to retrieve\n * the tag set associated with an object.
\n * Permissions\n *
\n *You need the s3:GetObject
permission for this operation. For more\n * information, see Specifying Permissions\n * in a Policy. If the object you request does not exist, the error Amazon S3 returns\n * depends on whether you also have the s3:ListBucket
permission.
If you have the s3:ListBucket
permission on the bucket, Amazon S3 will\n * return an HTTP status code 404 (\"no such key\") error.
If you don’t have the s3:ListBucket
permission, Amazon S3 will return an\n * HTTP status code 403 (\"access denied\") error.
\n * Versioning\n *
\n *By default, the GET operation returns the current version of an object. To return a\n * different version, use the versionId
subresource.
If the current version of the object is a delete marker, Amazon S3 behaves as if the\n * object was deleted and includes x-amz-delete-marker: true
in the\n * response.
For more information about versioning, see PutBucketVersioning.
\n *\n *\n * Overriding Response Header Values\n *
\n *There are times when you want to override certain response header values in a GET\n * response. For example, you might override the Content-Disposition response header value in\n * your GET request.
\n *\n *You can override values for a set of response headers using the following query\n * parameters. These response header values are sent only on a successful request, that is,\n * when status code 200 OK is returned. The set of headers you can override using these\n * parameters is a subset of the headers that Amazon S3 accepts when you create an object. The\n * response headers that you can override for the GET response are Content-Type
,\n * Content-Language
, Expires
, Cache-Control
,\n * Content-Disposition
, and Content-Encoding
. To override these\n * header values in the GET response, you use the following request parameters.
You must sign the request, either using an Authorization header or a presigned URL,\n * when using these parameters. They cannot be used with an unsigned (anonymous)\n * request.
\n *\n * response-content-type
\n *
\n * response-content-language
\n *
\n * response-expires
\n *
\n * response-cache-control
\n *
\n * response-content-disposition
\n *
\n * response-content-encoding
\n *
\n * Additional Considerations about Request Headers\n *
\n *\n *If both of the If-Match
and If-Unmodified-Since
headers are\n * present in the request as follows: If-Match
condition evaluates to\n * true
, and; If-Unmodified-Since
condition evaluates to\n * false
; then, S3 returns 200 OK and the data requested.
If both of the If-None-Match
and If-Modified-Since
headers are\n * present in the request as follows: If-None-Match
condition evaluates to\n * false
, and; If-Modified-Since
condition evaluates to\n * true
; then, S3 returns 304 Not Modified response code.
For more information about conditional requests, see RFC 7232.
\n *\n *The following operations are related to GetObject
:
\n * ListBuckets\n *
\n *\n * GetObjectAcl\n *
\n *Removes the null version (if there is one) of an object and inserts a delete marker,\n * which becomes the latest version of the object. If there isn't a null version, Amazon S3 does\n * not remove any objects.
\n *\n *To remove a specific version, you must be the bucket owner and you must use the version\n * Id subresource. Using this subresource permanently deletes the version. If the object\n * deleted is a delete marker, Amazon S3 sets the response header,\n * x-amz-delete-marker
, to true.
If the object you want to delete is in a bucket where the bucket versioning\n * configuration is MFA Delete enabled, you must include the x-amz-mfa
request\n * header in the DELETE versionId
request. Requests that include\n * x-amz-mfa
must use HTTPS.
For more information about MFA Delete, see Using MFA Delete. To see sample requests that use versioning, see Sample Request.
\n *\n *You can delete objects by explicitly calling the DELETE Object API or configure its\n * lifecycle (PutBucketLifecycle) to\n * enable Amazon S3 to remove them for you. If you want to block users or accounts from removing or\n * deleting objects from your bucket, you must deny them the s3:DeleteObject
,\n * s3:DeleteObjectVersion
, and s3:PutLifeCycleConfiguration
\n * actions.
The following operation is related to DeleteObject
:
\n * PutObject\n *
\n *Returns some or all (up to 1,000) of the objects in a bucket. You can use the request\n * parameters as selection criteria to return a subset of the objects in a bucket. A 200 OK\n * response can contain valid or invalid XML. Be sure to design your application to parse the\n * contents of the response and handle it appropriately.
\n *This API has been revised. We recommend that you use the newer version, ListObjectsV2, when developing applications. For backward compatibility,\n * Amazon S3 continues to support ListObjects
.
The following operations are related to ListObjects
:
\n * ListObjectsV2\n *
\n *\n * GetObject\n *
\n *\n * PutObject\n *
\n *\n * CreateBucket\n *
\n *\n * ListBuckets\n *
\n *