summaryrefslogtreecommitdiff
path: root/Doc/library/http.client.rst
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2013-03-19 00:58:46 -0700
committerSenthil Kumaran <senthil@uthcode.com>2013-03-19 00:58:46 -0700
commitc1353ff65c4f51c3a625072f3a6454e3e323ae68 (patch)
tree347b7704e559694cef2c7e8c43b44497c605df65 /Doc/library/http.client.rst
parent7a37e7ae0045ef89e9c2e2ca89995d67792c9510 (diff)
parentef6c27c10fd40d6be9528d9c4ce3fc0756cd6447 (diff)
downloadcpython-c1353ff65c4f51c3a625072f3a6454e3e323ae68.tar.gz
#17460 - merge from 3.2
Diffstat (limited to 'Doc/library/http.client.rst')
-rw-r--r--Doc/library/http.client.rst33
1 files changed, 28 insertions, 5 deletions
diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst
index 7423a4cd36..8137573aa8 100644
--- a/Doc/library/http.client.rst
+++ b/Doc/library/http.client.rst
@@ -51,7 +51,7 @@ The module provides the following classes:
.. versionchanged:: 3.2
*source_address* was added.
- .. deprecated:: 3.2
+ .. deprecated-removed:: 3.2 3.4
The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
are not supported anymore.
@@ -89,7 +89,7 @@ The module provides the following classes:
This class now supports HTTPS virtual hosts if possible (that is,
if :data:`ssl.HAS_SNI` is true).
- .. deprecated:: 3.2
+ .. deprecated-removed:: 3.2 3.4
The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
are not supported anymore.
@@ -99,7 +99,7 @@ The module provides the following classes:
Class whose instances are returned upon successful connection. Not
instantiated directly by user.
- .. deprecated:: 3.2
+ .. deprecated-removed:: 3.2 3.4
The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
are not supported anymore.
@@ -343,6 +343,15 @@ and also the following constants for integer status codes:
| :const:`UPGRADE_REQUIRED` | ``426`` | HTTP Upgrade to TLS, |
| | | :rfc:`2817`, Section 6 |
+------------------------------------------+---------+-----------------------------------------------------------------------+
+| :const:`PRECONDITION_REQUIRED` | ``428`` | Additional HTTP Status Codes, |
+| | | :rfc:`6585`, Section 3 |
++------------------------------------------+---------+-----------------------------------------------------------------------+
+| :const:`TOO_MANY_REQUESTS` | ``429`` | Additional HTTP Status Codes, |
+| | | :rfc:`6585`, Section 4 |
++------------------------------------------+---------+-----------------------------------------------------------------------+
+| :const:`REQUEST_HEADER_FIELDS_TOO_LARGE` | ``431`` | Additional HTTP Status Codes, |
+| | | :rfc:`6585`, Section 5 |
++------------------------------------------+---------+-----------------------------------------------------------------------+
| :const:`INTERNAL_SERVER_ERROR` | ``500`` | HTTP/1.1, `RFC 2616, Section |
| | | 10.5.1 |
| | | <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1>`_ |
@@ -373,6 +382,12 @@ and also the following constants for integer status codes:
| :const:`NOT_EXTENDED` | ``510`` | An HTTP Extension Framework, |
| | | :rfc:`2774`, Section 7 |
+------------------------------------------+---------+-----------------------------------------------------------------------+
+| :const:`NETWORK_AUTHENTICATION_REQUIRED` | ``511`` | Additional HTTP Status Codes, |
+| | | :rfc:`6585`, Section 6 |
++------------------------------------------+---------+-----------------------------------------------------------------------+
+
+.. versionchanged:: 3.3
+ Added codes ``428``, ``429``, ``431`` and ``511`` from :rfc:`6585`.
.. data:: responses
@@ -506,6 +521,12 @@ statement.
Reads and returns the response body, or up to the next *amt* bytes.
+.. method:: HTTPResponse.readinto(b)
+
+ Reads up to the next len(b) bytes of the response body into the buffer *b*.
+ Returns the number of bytes read.
+
+ .. versionadded:: 3.3
.. method:: HTTPResponse.getheader(name, default=None)
@@ -614,8 +635,10 @@ Here is an example session that shows how to ``POST`` requests::
Client side ``HTTP PUT`` requests are very similar to ``POST`` requests. The
difference lies only the server side where HTTP server will allow resources to
-be created via ``PUT`` request. Here is an example session that shows how to do
-``PUT`` request using http.client::
+be created via ``PUT`` request. It should be noted that custom HTTP methods
++are also handled in :class:`urllib.request.Request` by sending the appropriate
++method attribute.Here is an example session that shows how to do ``PUT``
+request using http.client::
>>> # This creates an HTTP message
>>> # with the content of BODY as the enclosed representation