如何使用 boto3 发出 S3 HeadObject 请求

s3_headobject_example.py
import boto3

# 创建到 S3 的连接
s3 = boto3.client('s3',
    endpoint_url = 'https://minio.mydomain.com',
    aws_access_key_id = 'VO5APZH2B2KS75GWORFQ',
    aws_secret_access_key = 'IBVCAVULO2CQTOQEE6VQ'
)

s3.head_object(
    Bucket='my-bucket',
    Key='folder/example-object.txt'
)

Check out similar posts by category: Python, S3