Module urllib2 :: Class HTTPRedirectHandler
[hide private]
[frames] | no frames]

_ClassType HTTPRedirectHandler

BaseHandler --+
              |
             HTTPRedirectHandler

Instance Methods [hide private]
 
redirect_request(self, req, fp, code, msg, headers, newurl)
Return a Request or None in response to a redirect.
 
http_error_302(self, req, fp, code, msg, headers)
 
http_error_307(self, req, fp, code, msg, headers)
 
http_error_303(self, req, fp, code, msg, headers)
 
http_error_301(self, req, fp, code, msg, headers)

Inherited from BaseHandler: __lt__, add_parent, close

Class Variables [hide private]
  max_repeats = 4
  max_redirections = 10
  inf_msg = 'The HTTP server returned a redirect error that woul...

Inherited from BaseHandler: handler_order

Method Details [hide private]

redirect_request(self, req, fp, code, msg, headers, newurl)

 

Return a Request or None in response to a redirect.

This is called by the http_error_30x methods when a redirection response is received. If a redirection should take place, return a new Request to allow http_error_30x to perform the redirect. Otherwise, raise HTTPError if no-one else should try to handle this url. Return None if you can't but another Handler might.


Class Variable Details [hide private]

inf_msg

Value:
'''The HTTP server returned a redirect error that would lead to an inf\
inite loop.
The last 30x error message was:
'''