diff options
author | Georg Brandl <georg@python.org> | 2008-06-23 11:23:31 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-06-23 11:23:31 (GMT) |
commit | 0f7ede45693be57ba51c7aa23a0d841f160de874 (patch) | |
tree | 42f8f578bdf60432c9056b2e300529efb1d9c6b4 /Doc/library/urllib.request.rst | |
parent | aca8fd7a9dc96143e592076fab4d89cc1691d03f (diff) | |
download | cpython-0f7ede45693be57ba51c7aa23a0d841f160de874.zip cpython-0f7ede45693be57ba51c7aa23a0d841f160de874.tar.gz cpython-0f7ede45693be57ba51c7aa23a0d841f160de874.tar.bz2 |
Review the doc changes for the urllib package creation.
Diffstat (limited to 'Doc/library/urllib.request.rst')
-rw-r--r-- | Doc/library/urllib.request.rst | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index 4262836..d124d9a 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -7,9 +7,9 @@ .. sectionauthor:: Moshe Zadka <moshez@users.sourceforge.net> -The :mod:`urllib.request` module defines functions and classes which help in opening -URLs (mostly HTTP) in a complex world --- basic and digest authentication, -redirections, cookies and more. +The :mod:`urllib.request` module defines functions and classes which help in +opening URLs (mostly HTTP) in a complex world --- basic and digest +authentication, redirections, cookies and more. The :mod:`urllib.request` module defines the following functions: @@ -180,7 +180,7 @@ The following classes are provided: the ``User-Agent`` header, which is used by a browser to identify itself -- some HTTP servers only allow requests coming from common browsers as opposed to scripts. For example, Mozilla Firefox may identify itself as ``"Mozilla/5.0 - (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"``, while :mod:`urllib2`'s + (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"``, while :mod:`urllib`'s default user agent string is ``"Python-urllib/2.6"`` (on Python 2.6). The final two arguments are only of interest for correct handling of third-party @@ -1005,10 +1005,11 @@ HTTPErrorProcessor Objects For non-200 error codes, this simply passes the job on to the :meth:`protocol_error_code` handler methods, via :meth:`OpenerDirector.error`. - Eventually, :class:`urllib2.HTTPDefaultErrorHandler` will raise an + Eventually, :class:`HTTPDefaultErrorHandler` will raise an :exc:`HTTPError` if no other handler handles the error. -.. _urllib2-examples: + +.. _urllib-request-examples: Examples -------- @@ -1180,15 +1181,18 @@ The following example uses no proxies at all, overriding environment settings:: using the :mod:`ftplib` module, subclassing :class:`FancyURLOpener`, or changing *_urlopener* to meet your needs. + + :mod:`urllib.response` --- Response classes used by urllib. =========================================================== + .. module:: urllib.response :synopsis: Response classes used by urllib. The :mod:`urllib.response` module defines functions and classes which define a -minimal file like interface, including read() and readline(). The typical -response object is an addinfourl instance, which defines and info() method and -that returns headers and a geturl() method that returns the url. +minimal file like interface, including ``read()`` and ``readline()``. The +typical response object is an addinfourl instance, which defines and ``info()`` +method and that returns headers and a ``geturl()`` method that returns the url. Functions defined by this module are used internally by the :mod:`urllib.request` module. |