diff options
author | Larry Hastings <larry@hastings.org> | 2014-03-16 04:13:56 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-03-16 04:13:56 (GMT) |
commit | 3732ed24145c1ac77e99bcf85bccda3af095e696 (patch) | |
tree | 432a243f5f4d9720ec0cc202ee969f6175e450b7 /Doc/library/urllib.request.rst | |
parent | b6b6a6d587d267cbad490232d08faebd30fdb7e2 (diff) | |
download | cpython-3732ed24145c1ac77e99bcf85bccda3af095e696.zip cpython-3732ed24145c1ac77e99bcf85bccda3af095e696.tar.gz cpython-3732ed24145c1ac77e99bcf85bccda3af095e696.tar.bz2 |
Merge in all documentation changes since branching 3.4.0rc1.
Diffstat (limited to 'Doc/library/urllib.request.rst')
-rw-r--r-- | Doc/library/urllib.request.rst | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index 20449d9..6ac9081 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -218,7 +218,7 @@ The following classes are provided: fetching of the image, this should be true. *method* should be a string that indicates the HTTP request method that - will be used (e.g. ``'HEAD'``). Its value is stored in the + will be used (e.g. ``'HEAD'``). If provided, its value is stored in the :attr:`~Request.method` attribute and is used by :meth:`get_method()`. Subclasses may indicate a default method by setting the :attr:`~Request.method` attribute in the class itself. @@ -440,13 +440,20 @@ request. .. attribute:: Request.method - The HTTP request method to use. This value is used by - :meth:`~Request.get_method` to override the computed HTTP request - method that would otherwise be returned. This attribute is initialized with - the value of the *method* argument passed to the constructor. + The HTTP request method to use. By default its value is :const:`None`, + which means that :meth:`~Request.get_method` will do its normal computation + of the method to be used. Its value can be set (thus overriding the default + computation in :meth:`~Request.get_method`) either by providing a default + value by setting it at the class level in a :class:`Request` subclass, or by + passing a value in to the :class:`Request` constructor via the *method* + argument. .. versionadded:: 3.3 + .. versionchanged:: 3.4 + A default value can now be set in subclasses; previously it could only + be set via the constructor argument. + .. method:: Request.get_method() |