title: AWS Content Type Settings in S3 Using Boto3
body: <p>I am trying to upload a web page to an S3 bucket using Amazon's <a href="https://aws.amazon.com/sdk-for-python/" rel="noreferrer">Boto3 SDK</a> for Python.</p>
  
  <p>I am having trouble setting the <code>Content-Type</code>. AWS keeps creating a new metadata key for <code>Content-Type</code> in addition to the one I'm specifying using this code:</p>
  
  <pre><code># Upload a new file
  data = open('index.html', 'rb')
  x = s3.Bucket('website.com').put_object(Key='index.html', Body=data)
  x.put(Metadata={'Content-Type': 'text/html'})
  </code></pre>
  
  <p>Any guidance of how to set <code>Content-Type</code> to <code>text/html</code> would be greatly appreciated.</p>