Example 1: Adding an ACL to a bucket by specifying individual grants

Here’s a sample PUT request that adds an ACL to the finance bucket by using x-amz-grant- headers. The ACL grants read permission to all users, write permission to user pdgrey, and write, read ACL, and write ACL permission to user mwhite.

Request with s3curl command line

./s3curl.pl --id=lgreen --put ~ -- -k "https://europe.hcp.example.com/finance?acl"
     -H "x-amz-grant-read: emailAddress=all_users"
     -H "x-amz-grant-write: emailAddress=pdgrey, emailAddress=mwhite"
     -H "x-amz-grant-read-acp: emailAddress=mwhite"
     -H "x-amz-grant-write-acp: emailAddress=mwhite"

Request headers

PUT /finance?acl HTTP/1.1
Host: europe.hcp.example.com
Date: Fri, 07 February 2020 17:19:26 +0000
Authorization: AWS bGdyZWVu:RuKD8rwRevmwLo+ZMhF5beGq7Qk=
x-amz-grant-read: emailAddress=all_users
x-amz-grant-write: emailAddress=pdgrey, emailAddress=mwhite
x-amz-grant-read-acp: emailAddress=mwhite
x-amz-grant-write-acp: emailAddress=mwhite

Response headers

HTTP/1.1 200 OK
Date: Fri, 07 February 2020 17:19:26 GMT
Content-Length: 0

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