Content-Type
isn't custom metadata, which is what Metadata
is used for. It has its own property which can be set like this:
bucket.put_object(Key='index.html', Body=data, ContentType='text/html')
Note: .put_object()
can set more than just Content-Type
. Check out the Boto3 documentation for the rest.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…