[Python-checkins] cpython (merge 3.5 -> default): [merge from 3.5] - Issue28010 - Make http.client.HTTPConnection.putrequest

senthil.kumaran python-checkins at python.org
Thu Sep 8 17:30:19 EDT 2016


https://hg.python.org/cpython/rev/93c7a893f9b4
changeset:   103359:93c7a893f9b4
parent:      103357:6142d2d3c471
parent:      103358:f6b62cf4a436
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Thu Sep 08 14:29:23 2016 -0700
summary:
  [merge from 3.5] - Issue28010 - Make http.client.HTTPConnection.putrequest
                   documentation consistent with the code.

files:
  Doc/library/http.client.rst |  24 +++++++++---------------
  Lib/http/client.py          |   3 ++-
  2 files changed, 11 insertions(+), 16 deletions(-)


diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst
--- a/Doc/library/http.client.rst
+++ b/Doc/library/http.client.rst
@@ -31,8 +31,7 @@
 The module provides the following classes:
 
 
-.. class:: HTTPConnection(host, port=None[, timeout], \
-                          source_address=None)
+.. class:: HTTPConnection(host, port=None[, timeout], source_address=None)
 
    An :class:`HTTPConnection` instance represents one transaction with an HTTP
    server.  It should be instantiated passing it a host and optional port
@@ -196,7 +195,6 @@
 
    The default port for the HTTP protocol (always ``80``).
 
-
 .. data:: HTTPS_PORT
 
    The default port for the HTTPS protocol (always ``443``).
@@ -340,14 +338,15 @@
 also send your request step by step, by using the four functions below.
 
 
-.. method:: HTTPConnection.putrequest(request, selector, skip_host=False, skip_accept_encoding=False)
+.. method:: HTTPConnection.putrequest(method, url, skip_host=False, \
+                                      skip_accept_encoding=False)
 
-   This should be the first call after the connection to the server has been made.
-   It sends a line to the server consisting of the *request* string, the *selector*
-   string, and the HTTP version (``HTTP/1.1``).  To disable automatic sending of
-   ``Host:`` or ``Accept-Encoding:`` headers (for example to accept additional
-   content encodings), specify *skip_host* or *skip_accept_encoding* with non-False
-   values.
+   This should be the first call after the connection to the server has been
+   made. It sends a line to the server consisting of the *method* string,
+   the *url* string, and the HTTP version (``HTTP/1.1``).  To disable automatic
+   sending of ``Host:`` or ``Accept-Encoding:`` headers (for example to accept
+   additional content encodings), specify *skip_host* or *skip_accept_encoding*
+   with non-False values.
 
 
 .. method:: HTTPConnection.putheader(header, argument[, ...])
@@ -425,7 +424,6 @@
    return all of the values joined by ', '.  If 'default' is any iterable other
    than a single string, its elements are similarly returned joined by commas.
 
-
 .. method:: HTTPResponse.getheaders()
 
    Return a list of (header, value) tuples.
@@ -440,22 +438,18 @@
    headers.  :class:`http.client.HTTPMessage` is a subclass of
    :class:`email.message.Message`.
 
-
 .. attribute:: HTTPResponse.version
 
    HTTP protocol version used by server.  10 for HTTP/1.0, 11 for HTTP/1.1.
 
-
 .. attribute:: HTTPResponse.status
 
    Status code returned by server.
 
-
 .. attribute:: HTTPResponse.reason
 
    Reason phrase returned by server.
 
-
 .. attribute:: HTTPResponse.debuglevel
 
    A debugging hook.  If :attr:`debuglevel` is greater than zero, messages
diff --git a/Lib/http/client.py b/Lib/http/client.py
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -1068,7 +1068,8 @@
                 # end chunked transfer
                 self.send(b'0\r\n\r\n')
 
-    def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
+    def putrequest(self, method, url, skip_host=False,
+                   skip_accept_encoding=False):
         """Send a request to the server.
 
         `method' specifies an HTTP request method, e.g. 'GET'.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list