Package zeroinstall :: Package injector :: Module _download_child :: Class MyRedirectHandler
[frames] | no frames]

Class MyRedirectHandler

source code

    urllib2.BaseHandler --+    
                          |    
urllib2.HTTPRedirectHandler --+
                              |
                             MyRedirectHandler

Throw an exception on redirects instead of continuing. The redirect will be handled in the main thread so it can work with connection pooling.

Instance Methods
 
redirect_request(self, req, fp, code, msg, headers, newurl)
Return a Request or None in response to a redirect.
source code

Inherited from urllib2.HTTPRedirectHandler: http_error_301, http_error_302, http_error_303, http_error_307

Inherited from urllib2.BaseHandler: __lt__, add_parent, close

Class Variables

Inherited from urllib2.HTTPRedirectHandler: inf_msg, max_redirections, max_repeats

Inherited from urllib2.BaseHandler: handler_order

Method Details

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

source code 

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.

Parameters:
  • msg (str)
  • newurl (str)
  • code (int)
Overrides: urllib2.HTTPRedirectHandler.redirect_request