S3 API: Object Operations

S3 will show the result lexicographically.

List buckets

GET https://<s3-url>

String to sign:

GET



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/

Get bucket ACL

GET https://<s3-url>/<bucket-name>/?acl

String to sign:

GET



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>/?acl

List bucket contents

GET https://<s3-url>/<bucket-name>

String to sign:

GET



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>
GET https://<s3-url>/<bucket-name>/

String to sign:

GET



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>/

List object

GET https://<s3-url>/<bucket-name>/?delimiter=Delimiter&encoding-type=EncodingType&marker=Marker&max-keys=MaxKeys&prefix=Prefix&marker=Marker
  • Prefix: Folder name eg. “test”, “test/” or “test/test1”, “test/test1/” (case-sensitive).
  • MaxKeys: Maximum results to show (by default 1000 results).
  • Delimiter: Exclude results containing this value (case-sensitive).
  • EncodingType: Valid value “url”.
  • Marker: Show results starting from this key.

String to sign:

GET



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>/

Get object

GET https://<s3-url>/<bucket-name>/<folder>/<filename>

String to sign:

GET



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>/<folder>/<filename>

Delete object

  • Deleting an object will return an empty response (204 No Content).
  • To delete a folder, you must delete its children first.
DELETE https://<s3-url>/<bucket-name>/<folder>/<filename>

String to sign:

DELETE



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>/<folder>/<filename>
DELETE https://<s3-url>/<bucket-name>/<folder>

String to sign:

DELETE



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>/<folder>
DELETE https://<s3-url>/<bucket-name>/<folder>/

String to sign:

DELETE



x-amz-date:Sat, 09 Apr 2022 02:41:04 +0000
/<bucket-name>/<folder>/

Resources:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *