GetObject

Last update:2025-08-18 15:52:04

The user who owns the bucket where the object is stored can perform a GET operation. The response will include both the object’s content and its metadata.

Request syntax

GET /ObjectName?response-cache-control=ResponseCacheControl&response-content-disposition=ResponseContentDisposition&response-content-encoding=ResponseContentEncoding&response-content-language=ResponseContentLanguage&response-content-type=ResponseContentType&response-expires=ResponseExpires HTTP/1.1
 
Host: Bucket.Endpoint
Date: date
Authorization: authorization
 

URI request parameters

It’s allowed to rewrite response headers by request parameters when getting object. The rewritable headers are: Content-Type, Expires, Content-language, Cache-Control, Content-Disposition, Content- Encoding.

Parameter Description Required
response-content-type Rewrite Content-Type header in response.
Different ContentTypes lead to different views of the user. text/html by default, that is, the webpage. For example, text/html;charset=utf-8.
Type: String.
No
response-expires Rewrite Expires header in response, which indicating browser cache expiration time.
Type: String.
No
response-content-language Rewrite Content-Language header in response.
Type: String.
No
response-cache-control Rewrite the Cache-Control header in response, which controls the web page caching . Common values ​​are private, no-cache, max-age, must-revalidate, etc. The default is private.
Type: String.
No
response-content-disposition Rewrite Content-Disposition header in response, which provides a default file name when the user wants to save the requested content as a file. Example: attachment; filename="cool.html"
Type: String.
No
response-content-encoding Rewrite Content-Encoding header in response. Examples: gzip, deflate
Type: String.
No

Request header

In addition to Common Request Headers , it also contains

Parameter Description Required
If-Match If the ETag of the object is the same as the ETag specified in the request , return the content of the object, otherwise return 412 ( precondition failed ) ( not found )
Type: string. ( ETag value, for example: 0f64741bf7cb1089e988e4585d0d3434 )
No
If-Modified-Since If the modification time of the object is after this value, return the content of the object; otherwise, return 304 (not modified) .
Type: string.
No
If-Unmodified-Since If the modification time of the object is before this value, return the content of the object; otherwise, return 412 ( precondition failed ).
Type: string.
No
If-None-Match If the ETag of the object is not the same as the ETag specified in the request , the object content is returned, otherwise 304 ( not modified ) is returned .
Type: string.
No
Range Acquires the acquired object Range target content range; if Range undesirable rules packets 416 Requested Range Not Satisfiable; Range is a range that is a minimum starting value 0 , the maximum object length minus 1.
Type: string. ( Bytes=byte_range example: bytes=0-4 or bytes=512-1024 )
No

Request body

None

Response syntax

HTTP/1.1 status_code
 
x-wos-request-id: request id
Content-Type: type
Date: date
Content-Length: length
Etag: etag
Last-Modified: time
<Object Content>
 

Response headers

In addition to Common Response Headers , the following headers are also available

Name Description
Etag Entity tag of uploaded data.
x-wos-storage-class Specifies the storage class of the file. Supported values include: Standard (standard storage), IA (infrequent access storage), and Archive (archive storage). Defaults to the bucket’s storage class.
x-amz-meta-* Customized metadata.

Note: If you are accessing a static file (including files in formats such as htm, html, jsp, plg, htx, and stm), the response will include an additional Content-Disposition: attachment header, prompting the browser to download the file. If you want the browser to preview these types of files instead, you can bind your custom domain in the bucket management settings. Accessing the file through your custom domain will not add the Content-Disposition: attachment header.

Response body

None

Example

GET /test HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/1
Host: bucket.s3-cn-east-1.wcsapi.com
Accept: */*
Date: Sat, 03 Dec 2011 08:28:02 +0000
Authorization: AWS BF6C09F302931425E9A7:tQ+A280jUgPCAdSTuUis35T9gWI=
 
 
HTTP/1.1 200 OK
 
x-wos-request-id: 001B21A61C6C0000013403098535528C
x-wos-storage-class: Standard
ETag: "507e3fff69b69bf57d303e807448560b"
Last-Modified: Sat, 03 Dec 2011 08:25:46 GMT
Accept-Ranges: bytes
Content-Length: 30
Content-Type: binary/octet-stream
Date: Sat, 03 Dec 2011 08:28:02 GMT
 
[30 bytes of object data]
 
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!