• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (OBS)
  4. Operations on Objects
  5. GET Object
  6. Examples

Examples

Sample Request for Not Overriding Response Headers

GET /test HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Sat, 03 Dec 2011 08:28:02 +0000 
 Authorization: AWS BF6C09F302931425E9A7:tQ+A280jUgPCAdSTuUis35T9gWI=

Sample Response for Not Overriding Response Headers

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: 001B21A61C6C0000013403098535528C 
 x-amz-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMzA5ODUzNTUyOENBQUFBQUFBQWJiYmJiYmJi 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 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     

Sample Request for Overriding Headers

GET /test?response-cache-control=No-cache&response-content-disposition=attachment%3B%20filename%3Dtesting.txt&response-content-encoding=x-gzip&response-content-language=mi%2C%20en&response-expires=Thu%2C%2001%20Dec%201994%2016:00:00%20GMT HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Sat, 03 Dec 2011 08:28:02 +0000 
 Authorization: AWS BF6C09F302931425E9A7: aaStE6nKnw8ihhiIdReoXYlMamW=

Sample Response for Overriding Headers

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: 001B21A61C6C0000013403098535528C 
 x-amz-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMzA5ODUzNTUyOENBQUFBQUFBQWJiYmJiYmJi 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 ETag: "507e3fff69b69bf57d303e807448560b" 
 Last-Modified: Sat, 03 Dec 2011 08:25:46 GMT 
 Accept-Ranges: bytes 
 Content-Length: 30 
 Cache-Control: No-cache 
 Content-Language: mi, en 
 Expires: Thu, 01 Dec 1994 16:00:00 GMT 
 Content-Disposition: attachment; filename=testing.txt 
 Content-Encoding: x-gzip 
 Content-Type: binary/octet-stream 
 Date: Sat, 03 Dec 2011 08:28:02 GMT 

Sample Request for Getting an Object with Version ID Specified

GET /object?versionId=AAABQ47OMnbc0vycq3gAAAANVURTRkha HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Tue, 14 Jan 2014 06:11:49 +0000 
 Authorization: AWS C9590CEB8EC051BDEC9D:kpuA5lb+IoEOglV5824R4Yb18RE=

Sample Response for Getting an Object with Version ID Specified

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB78000001438F609AD59896 
 x-amz-id-2: nz0bi6ru2wS4OvhkCS1OQ2FwyxjvYwuGv1EI5JVeDpuGwX6weBoX7MRxJwhuXJu9 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Accept-Ranges: bytes 
 ETag: "ba1f2511fc30423bdbb183fe33f3dd0f" 
 Last-Modified: Tue, 14 Jan 2014 03:31:54 GMT 
 Content-Length: 4 
 x-amz-version-id: AAABQ47OMnbc0vycq3gAAAANVURTRkha 
 Content-Type: binary/octet-stream 
 Date: Tue, 14 Jan 2014 06:11:49 GMT 

 [4 bytes of object data]

Sample Request for Getting an Object Whose Latest Version ID Is a Deletion Mark

GET /object HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Tue, 14 Jan 2014 06:17:59 +0000 
 Authorization: AWS C9590CEB8EC051BDEC9D:MsZcBz1QOULDOhPP1gx1+4hbh4A=

Sample Response for Getting an Object Whose Latest Version ID Is a Deletion Mark

HTTP/1.1 404 Not Found 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB78000001438F6640529BA9 
 x-amz-id-2: /BdlSJIqa5Gkl3yEoEgmJKUUak0xjtgCTn9LhbsyJwqG5OVqrkfiateRxF8Gg4AU 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 x-amz-version-id: AAABQ49lNT_c0vycq3gAAAAOVURTRkha 
 x-amz-delete-marker: true 
 Date: Tue, 14 Jan 2014 06:17:59 GMT 
 Content-Length: 297

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <Error> 
 <Code>NoSuchKey</Code> 
 <Message>The specified key does not exist.</Message> 
 <RequestId>DCD2FC9CAB78000001438F6640529BA9</RequestId> 
 <HostId>nkbX5Pw7vRd26kP6gRwQQ4AxiN446dN608LMf4/9h/NMdhrWsc17Vnlva6VS23dq</HostId> 
 <Key>object</Key> 
 </Error>

Sample Request for Getting an Object and CORS Configuration when CORS is properly configured

GET /object HTTP/1.1
User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8{ zlib/1.2.3 libidn/1.10
Host: bucketname.obs.example.com
Accept: */*
Date: Tue, 28 Apr 2015 13:36:06 +0000
Authorization: AWS D13E0C94E722DD69423C:9PzAsaQnzJfMb2pcUNzaYpxgtSE=
Origin:www.example.com
Access-Control-Request-Headers:acc_header_1

Sample Response for Getting an Object and CORS Configuration when CORS is properly configured

HTTP/1.1 200 OK
x-amz-request-id: 0B2B8A2B224F067CB15E4203ABF583F4
x-amz-id-2: PI5ZL3VEM6LnENYPchIQLKDfMlHanhkCz+CgmqCmyN0AniJZMGKBij9bj7fm4sve
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
Access-Control-Allow-Origin: www.example.com
Access-Control-Allow-Methods: POST,GET,HEAD,PUT
Access-Control-Allow-Headers: acc_header_01
Access-Control-Max-Age: 100
Access-Control-Expose-Headers: exp_header_01
Accept-Ranges: bytes
ETag: "6bcb16084a88ae550811429c0c1e8bc7"
Last-Modified: Tue, 28 Apr 2015 13:38:05 GMT
Content-Length: 264
Content-Type: binary/octet-stream
Date: Tue, 28 Apr 2015 13:38:17 GMTa