Object Operations¶
PutObject¶
Uploads an object.
Request:
PUT /my-bucket/my-key HTTP/1.1
Host: s3.example.com
Content-Type: application/octet-stream
Content-Length: 1024
[binary data]
Headers:
| Header | Description |
|---|---|
Content-Type |
MIME type |
Content-MD5 |
Base64 MD5 for integrity |
x-amz-storage-class |
Storage class |
x-amz-server-side-encryption |
AES256 |
x-amz-meta-* |
Custom metadata |
Response:
GetObject¶
Downloads an object.
Request:
Optional Headers:
| Header | Description |
|---|---|
Range |
Byte range bytes=0-1023 |
If-Match |
ETag condition |
If-None-Match |
ETag condition |
If-Modified-Since |
Date condition |
Query Parameters:
| Parameter | Description |
|---|---|
versionId |
Specific version |
response-content-type |
Override Content-Type |
response-content-disposition |
Override Content-Disposition |
HeadObject¶
Gets metadata without body.
Request:
Response: Headers only, no body.
DeleteObject¶
Deletes an object.
Request:
Response: 204 No Content
CopyObject¶
Copies an object.
Request:
ListObjectsV2¶
Lists objects in a bucket.
Request:
Parameters:
| Parameter | Description |
|---|---|
list-type |
Must be 2 |
prefix |
Filter by prefix |
delimiter |
Grouping character |
max-keys |
Maximum results |
continuation-token |
Pagination |
Response:
<ListBucketResult>
<n>my-bucket</n>
<Contents>
<Key>folder/file.txt</Key>
<Size>1024</Size>
<LastModified>2024-01-01T00:00:00.000Z</LastModified>
<ETag>"etag"</ETag>
</Contents>
</ListBucketResult>