ID EN
Urllib Request

redirect_request

Python 3.11

Return a Request or None in response to a redirect. This is called by the default implementations of the http_error_30*() methods when a redirection is received from the server. If a redirection should take place, return a new Request to allow http_error_30*() to perform the redirect to newurl. Otherwise, raise HTTPError if no other handler should try to handle this URL, or return None if you can’t but another handler might.

Syntax

PYTHON
HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl)

See Also

Request Request HTTPError