summaryrefslogtreecommitdiff
path: root/Doc/library/urllib.request.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/urllib.request.rst')
-rw-r--r--Doc/library/urllib.request.rst16
1 files changed, 14 insertions, 2 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
index d878aac557..82fc1b2812 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -63,7 +63,7 @@ The :mod:`urllib.request` module defines the following functions:
:class:`http.client.HTTPResponse` object which has the following
:ref:`httpresponse-objects` methods.
- For ftp, file, and data urls and requests explicity handled by legacy
+ For ftp, file, and data urls and requests explicitly handled by legacy
:class:`URLopener` and :class:`FancyURLopener` classes, this function
returns a :class:`urllib.response.addinfourl` object which can work as
:term:`context manager` and has methods such as
@@ -110,6 +110,7 @@ The :mod:`urllib.request` module defines the following functions:
.. versionchanged:: 3.4.3
*context* was added.
+
.. function:: install_opener(opener)
Install an :class:`OpenerDirector` instance as the default global opener.
@@ -300,6 +301,17 @@ The following classes are provided:
presented with a wrong Authentication scheme.
+.. class:: HTTPBasicPriorAuthHandler(password_mgr=None)
+
+ A variant of :class:`HTTPBasicAuthHandler` which automatically sends
+ authorization credentials with the first request, rather than waiting to
+ first receive a HTTP 401 "Unauthorised" error response. This allows
+ authentication to sites that don't provide a 401 response when receiving
+ a request without an Authorization header. Aside from this difference,
+ this behaves exactly as :class:`HTTPBasicAuthHandler`.
+
+ .. versionadded:: 3.5
+
.. class:: ProxyBasicAuthHandler(password_mgr=None)
Handle authentication with the proxy. *password_mgr*, if given, should be
@@ -1067,7 +1079,7 @@ The following W3C document, http://www.w3.org/International/O-charset\ , lists
the various ways in which a (X)HTML or a XML document could have specified its
encoding information.
-As the python.org website uses *utf-8* encoding as specified in it's meta tag, we
+As the python.org website uses *utf-8* encoding as specified in its meta tag, we
will use the same for decoding the bytes object. ::
>>> with urllib.request.urlopen('http://www.python.org/') as f: