How do I set the Content-Type of an existing S3 key with boto3?
<p>I want to update the Content-Type of an existing object in a S3 bucket, using boto3, but how do I do that, without having to re-upload the file?</p>

<pre><code>    file_object = s3.Object(bucket_name, key)
    print file_object.content_type
    # binary/octet-stream
    file_object.content_type = 'application/pdf'
    # AttributeError: can't set attribute
</code></pre>

<p>Is there a method for this I have missed in boto3?</p>

<p><strong>Related questions:</strong></p>

<ul>
<li><a href="https://stackoverflow.com/questions/34550816/aws-content-type-settings-in-s3-using-boto3">How to set Content-Type on upload</a></li>
<li><a href="https://stackoverflow.com/questions/23467044/how-to-set-the-content-type-of-an-s3-object-via-the-sdk">How to set the content type of an S3 object via the SDK?</a></li>
</ul>