GetObject

Last update:2022-03-01 18:01:07

Get content and metadata of the object.

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 header , 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-amz-meta-* Customized metadata.

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!