Get Object

2023-02-19 21:08:10

Get Object

GET操作从对象存储下载对象。

请求语法

GET /Key+?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.s3-us-east-1.ossfiles.com
Range: Range

URI 请求参数

名称 描述 类型
Bucket 存储桶名称 字符串
Key 对象名称 字符串
response-content-type 重写响应中的Content-Type头。 字符串
response-content-language 重写响应中的Content-Language头。 字符串
response-expires 重写响应中的Expires头。 字符串
response-cache-control 重写响应中的Cache-Control头。 字符串
response-content-disposition 重写响应中的Content-Disposition头。 字符串
response-content-encoding 重写响应中的Content-Encoding头。 字符串
attname 重写响应中的Content-Disposition头。 字符串
x-image-process 图片处理服务。 字符串

请求消息头

名称 描述 类型
Range 获取对象时,获取在Range范围内的对象内容。如果Range不合法则忽略此字段获取整个对象。
Range是一个范围,它的起始值最小为0,最大为对象长度减1。Range范围的起始值为必填项,如果Range只包含起始值,表示获取起始值到对象长度减1这个区间的对象内容。
携带Range头域后,响应消息的ETag仍是对象的ETag,而不是Range范围内对象的ETag。
字符串

请求正文

该请求没有请求正文。


请求元素

该请求没有请求元素。


响应语法

该请求没有响应语法。


响应消息头

名称 描述 类型
Cache-Control 通过指定指令来实现缓存机制。 字符串
Content-Disposition 响应头指示回复的内容该以何种形式展示。 字符串
Content-Encoding 编码类型 字符串
Content-Language 用来说明访问者希望采用的语言或语言组合 字符串
Content-Length 内容字节数 整数型
Last-Modified 最近修改时间 时间
Content-Type 实体头部用于指示资源的 MIME 类型 字符串
Expires 响应头包含日期/时间,即在此时候之后,响应过期 字符串
x-amz-* 字符串

示例

请求示例

GET /get_Object_test HTTP/1.1
Authorization: AWS4-HMAC-SHA256 Credential=2421a691b4ed625de19f6f92677b6459/20230117/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=98c5aa69c62fd9bba0837bdc8bf4651b52c752acacfcc5d436e50617e69527aa
Content-length: 0
Host: bucket.s3-us-east-1.ossfiles.com
X-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-amz-date: 20230117T120729Z

返回示例

HTTP/1.1 200 OK
Accept-ranges: bytes
Cache-control: max-age=86400
Content-disposition: attachment
Content-length: 3
Content-type: application/octet-stream
Date: Tue, 17 Jan 2023 12:07:31 GMT
Etag: "202cb962ac59075b964b07152d234b70"
Last-modified: Tue, 17 Jan 2023 04:08:03 GMT
Storage-layer: LowFrequency
x-amz-id-2: 71d324c340d44d8d93f4663241d0bd7d
x-amz-request-id: aaa09e1b4f944e7f9e61589a3cf833d8