Conditionally retrieving an object example

Here’s a sample PUT request that retrieves the current version of the object named mktg/campaign_GoGetEm_expenses.xls in the finance bucket only if the ETag for the object doesn’t match a specified value. In this example, the specified value is the ETag of the first version of mktg/campaign_GoGetEm_expenses.xls. The request writes the object data to a file named mktg_GoGetEm.xls. The request is being made while versioning is enabled for the bucket.

Request with s3curl command line

./s3curl.pl --id=lgreen -- -k "https://finance.europe.hcp.example.com/mktg/
     campaign_GoGetEm_expenses.xls"
     -H 'If-None-     Match:"74d824cd5076a1361da128ee18e5a42b"' >
     mktg_GoGetEm.xls

Request headers

GET /mktg/campaign_GoGetEm_expenses.xls HTTP/1.1
Host: finance.europe.hcp.example.com
Date: Fri, 12 Apr 2013 13:35:31 +0000
Authorization: AWS bGdyZWVu:3ymfU6KeNWnFEvpphFxYvJ881Wg=
If-None-Match: "74d824cd5076a1361da128ee18e5a42b"

Response headers

HTTP/1.1 200 OK
Date: Fri, 12 Apr 2013 13:35:30 GMT
Server: HCP V7.0.0.16
ETag: "6ed7faad1e0661c03ad65a4317d4a94c"
x-amz-version-id: 87288825190337
Last-Modified: Wed, 13 Feb 2013 17:44:53 GMT
Cache-Control: no-cache,no-store
Pragma: no-cache
Content-Type: application/vnd.ms-excel
Content-Length: 94328

Trademarks and Legal Disclaimer

© 2016 Hitachi Data Systems Corporation. All rights reserved.