parm530
5/13/2020 - 2:32 PM

Using curl command to query header information

Running the curl command to access assets in S3

  • To access an image from s3 using the curl command:
    • curl -I https://blah.com/blah.jpg
  • The information returned should look like:
HTTP/1.1 200 OK
x-amz-id-2: vssCWUJOxWDwerweterwtfX6tAab/QXvLwLXFYSwhGRMi/cF7VlGcmwzve74N1UnJlH1M=
x-amz-request-id: 1C0F977DA71D72ED
Date: Wed, 13 May 2020 14:28:51 GMT
Last-Modified: Wed, 03 Aug 2016 14:27:58 GMT
ETag: "229a653a21e79454535ec8bf5609f5826"
Accept-Ranges: bytes
Content-Type: image/jpeg
Content-Length: 79486
Server: AmazonS3
  • You can attach on --header "If-None-Match:229a653a21e79454535ec8bf5609f5826"
    • Replacing the value with the value of the ETag