Example 2: Retrieving an old version of an object

Here’s a sample GET request that retrieves an old version of the object named AcctgBestPractices.doc in the finance bucket. The request writes the object data to a file named AcctgBestPractices.doc-10-08-16.doc. 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/
     AcctgBestPractices.doc?versionId=87288808614529" >
     AcctgBestPractices-10-08-16.doc

Request headers

GET /AcctgBestPractices.doc?versionId=87288808614529 HTTP/1.1
Host: finance.europe.hcp.example.com
Date: Fri, 07 February 2020 17:19:26 +0000
Authorization: AWS bGdyZWVu:6Am3akZkcfc4fD3WXSBFr+dV7DE=

Response headers

HTTP/1.1 200 OK
Date: Fri, 07 February 2020 17:19:26 GMT
ETag: "5ab7542f753b09fdb73141a66c134b9"
Accept-Ranges: bytes
x-amz-version-id: 87288808614529
Last-Modified: Wed, 28 Dec 2016 21:06:52 GMT
Content-Type: application/msword
Content-Length: 3557448

© 2015, 2020 Hitachi Vantara LLC. All rights reserved.