title: Python - The request headers for mechanize
body: <p>I am looking for a way to view the request (not response) headers, specifically what browser mechanize claims to be. Also how would I go about manipulating them, eg setting another browser?</p>
  
  <p>Example:</p>
  
  <pre><code>import mechanize
  browser = mechanize.Browser()
  # Now I want to make a request to eg example.com with custom headers using browser
  </code></pre>
  
  <p>The purpose is of course to test a website and see whether or not it shows different pages depending on the reported browser.</p>
  
  <p>It has to be the mechanize browser as the rest of the code depends on it (but is left out as it's irrelevant.)</p>