title: Check the Response status -PYTHON
body: <p>I'm trying to make <strong>POST REQUEST</strong></p>
  
  <p>Then checking the  response header status code</p>
  
  <p>200 or 302 </p>
  
  <pre><code>import urllib
  import urllib2
  
  url = 'url' #url
  values = {'name' : 'Michael Foord',
            'location' : 'Northampton',
            'language' : 'Python' } #post data
  
  data = urllib.urlencode(values)
  req = urllib2.Request(url, data)
  response = urllib2.urlopen(req)
  </code></pre>
  
  <p>when i try</p>
  
  <p>response.getcode()</p>
  
  <p>the result is 200 even if the result is 302-FOUND
  Any idea ?</p>