summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-02-13 10:40:43 (GMT)
committerGeorg Brandl <georg@python.org>2009-02-13 10:40:43 (GMT)
commit9617a593e741fb5468699cb2e2612032822f578b (patch)
tree26f327b425e9eb75d4ec51aae06473e58ee357c7
parent76cb7edc80cd02950db94384a2a026cf86da4727 (diff)
downloadcpython-9617a593e741fb5468699cb2e2612032822f578b.zip
cpython-9617a593e741fb5468699cb2e2612032822f578b.tar.gz
cpython-9617a593e741fb5468699cb2e2612032822f578b.tar.bz2
#4894: document "newurl" parameter to redirect_request().
-rw-r--r--Doc/library/urllib.request.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
index ec55a04..60d70f2 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -741,14 +741,15 @@ HTTPRedirectHandler Objects
precise meanings of the various redirection codes.
-.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs)
+.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl)
Return a :class:`Request` or ``None`` in response to a redirect. This is called
by the default implementations of the :meth:`http_error_30\*` methods when a
redirection is received from the server. If a redirection should take place,
return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the
- redirect. Otherwise, raise :exc:`HTTPError` if no other handler should try to
- handle this URL, or return ``None`` if you can't but another handler might.
+ redirect to *newurl*. Otherwise, raise :exc:`HTTPError` if no other handler
+ should try to handle this URL, or return ``None`` if you can't but another
+ handler might.
.. note::
@@ -761,8 +762,8 @@ HTTPRedirectHandler Objects
.. method:: HTTPRedirectHandler.http_error_301(req, fp, code, msg, hdrs)
- Redirect to the ``Location:`` URL. This method is called by the parent
- :class:`OpenerDirector` when getting an HTTP 'moved permanently' response.
+ Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the
+ parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' response.
.. method:: HTTPRedirectHandler.http_error_302(req, fp, code, msg, hdrs)