title: Python: How to get the Content-Type of an URL?
body: <p>I need to get the content-type of an internet(intranet) resource not a local file.  How can I get the MIME type from a resource behind an URL:</p>
  
  <p>I tried this:</p>
  
  <pre><code>res = urllib.urlopen("http://www.iana.org/assignments/language-subtag-registry")
  http_message = res.info()
  message = http_message.getplist()
  </code></pre>
  
  <p>I get:
  <code>['charset=UTF-8']</code></p>
  
  <p>How can I get the <code>Content-Type</code>, can be done using <code>urllib</code> and how or if not what is the other way?  </p>