Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5dc504c3
Commit
5dc504c3
authored
Sep 08, 2016
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue28010 - Make http.client.HTTPConnection.putrequest documentation consistent with the code.
parent
37156a70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
16 deletions
+11
-16
Doc/library/http.client.rst
Doc/library/http.client.rst
+9
-15
Lib/http/client.py
Lib/http/client.py
+2
-1
No files found.
Doc/library/http.client.rst
View file @
5dc504c3
...
@@ -31,8 +31,7 @@ HTTPS protocols. It is normally not used directly --- the module
...
@@ -31,8 +31,7 @@ HTTPS protocols. It is normally not used directly --- the module
The module provides the following classes:
The module provides the following classes:
.. class:: HTTPConnection(host, port=None[, timeout], \
.. class:: HTTPConnection(host, port=None[, timeout], source_address=None)
source_address=None)
An :class:`HTTPConnection` instance represents one transaction with an HTTP
An :class:`HTTPConnection` instance represents one transaction with an HTTP
server. It should be instantiated passing it a host and optional port
server. It should be instantiated passing it a host and optional port
...
@@ -196,7 +195,6 @@ The constants defined in this module are:
...
@@ -196,7 +195,6 @@ The constants defined in this module are:
The default port for the HTTP protocol (always ``80``).
The default port for the HTTP protocol (always ``80``).
.. data:: HTTPS_PORT
.. data:: HTTPS_PORT
The default port for the HTTPS protocol (always ``443``).
The default port for the HTTPS protocol (always ``443``).
...
@@ -318,14 +316,15 @@ As an alternative to using the :meth:`request` method described above, you can
...
@@ -318,14 +316,15 @@ As an alternative to using the :meth:`request` method described above, you can
also send your request step by step, by using the four functions below.
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.
This should be the first call after the connection to the server has been
It sends a line to the server consisting of the *request* string, the *selector*
made. It sends a line to the server consisting of the *method* string,
string, and the HTTP version (``HTTP/1.1``). To disable automatic sending of
the *url* string, and the HTTP version (``HTTP/1.1``). To disable automatic
``Host:`` or ``Accept-Encoding:`` headers (for example to accept additional
sending of ``Host:`` or ``Accept-Encoding:`` headers (for example to accept
content encodings), specify *skip_host* or *skip_accept_encoding* with non-False
additional content encodings), specify *skip_host* or *skip_accept_encoding*
values.
with non-False
values.
.. method:: HTTPConnection.putheader(header, argument[, ...])
.. method:: HTTPConnection.putheader(header, argument[, ...])
...
@@ -384,7 +383,6 @@ statement.
...
@@ -384,7 +383,6 @@ statement.
return all of the values joined by ', '. If 'default' is any iterable other
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.
than a single string, its elements are similarly returned joined by commas.
.. method:: HTTPResponse.getheaders()
.. method:: HTTPResponse.getheaders()
Return a list of (header, value) tuples.
Return a list of (header, value) tuples.
...
@@ -399,22 +397,18 @@ statement.
...
@@ -399,22 +397,18 @@ statement.
headers. :class:`http.client.HTTPMessage` is a subclass of
headers. :class:`http.client.HTTPMessage` is a subclass of
:class:`email.message.Message`.
:class:`email.message.Message`.
.. attribute:: HTTPResponse.version
.. attribute:: HTTPResponse.version
HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1.
HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1.
.. attribute:: HTTPResponse.status
.. attribute:: HTTPResponse.status
Status code returned by server.
Status code returned by server.
.. attribute:: HTTPResponse.reason
.. attribute:: HTTPResponse.reason
Reason phrase returned by server.
Reason phrase returned by server.
.. attribute:: HTTPResponse.debuglevel
.. attribute:: HTTPResponse.debuglevel
A debugging hook. If :attr:`debuglevel` is greater than zero, messages
A debugging hook. If :attr:`debuglevel` is greater than zero, messages
...
...
Lib/http/client.py
View file @
5dc504c3
...
@@ -935,7 +935,8 @@ class HTTPConnection:
...
@@ -935,7 +935,8 @@ class HTTPConnection:
if
message_body
is
not
None
:
if
message_body
is
not
None
:
self
.
send
(
message_body
)
self
.
send
(
message_body
)
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.
"""Send a request to the server.
`method' specifies an HTTP request method, e.g. 'GET'.
`method' specifies an HTTP request method, e.g. 'GET'.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment