title: How to check for an HTTP status code of 401?
body: <p><a href="https://stackoverflow.com/questions/1899259/how-can-i-pass-my-id-and-my-password-to-a-website-in-python-using-google-app-engi">In one of the answers that I have received here</a>, I encountered a problem of not knowing how to pass automatically through "Google App Engines" my ID and a password to a website, on which I am a registered user and have an account. A suggestion was given to me to "check for an HTTP status code of 401, "authorization required", and provide the kind of HTTP authorization (basic, digest, whatever) that the site is asking for". I don't know how to check for status code. Can anyone, please, tell me how to do it? </p>
  
  <p>+++++++++++++++++++++++++++++++++</p>
  
  <p>Additional Information:</p>
  
  <p>If I use this way in Google App Engine (fetching the url of my eBay summary page):</p>
  
  <pre><code>from google.appengine.api import urlfetch
  url = "http://my.ebay.com/ws/eBayISAPI.dll?MyEbay&amp;gbh=1&amp;CurrentPage=MyeBaySummary&amp;ssPageName=STRK:ME:LNLK"
  result = urlfetch.fetch(url)
  if result.status_code == 200:
     print "content-type: text/plain"
     print
     print result.status_code
  </code></pre>
  
  <p>I always get "200" instead of "401"</p>