8000 Update http.client.rst (GH-24803) · python/cpython@789d5bc · GitHub
[go: up one dir, main page]

Skip to content

Commit 789d5bc

Browse files
Update http.client.rst (GH-24803)
* Update http.client.rst * Apply suggestions from code review Co-authored-by: Éric <merwok@netwok.org> * Update http.client.rst Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Senthil Kumaran <senthil@python.org> (cherry picked from commit 0c91a12) Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
1 parent 541265f commit 789d5bc

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Doc/library/http.client.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The module provides the following classes:
6161

6262
.. versionchanged:: 3.4
6363
The *strict* parameter was removed. HTTP 0.9-style "Simple Responses" are
64-
not longer supported.
64+
no longer supported.
6565

6666
.. versionchanged:: 3.7
6767
*blocksize* parameter was added.
@@ -474,7 +474,7 @@ statement.
474474

475475
Return the value of the header *name*, or *default* if there is no header
476476
matching *name*. If there is more than one header with the name *name*,
477-
return all of the values joined by ', '. If 'default' is any iterable other
477+
return all of the values joined by ', '. If *default* is any iterable other
478478
than a single string, its elements are similarly returned joined by commas.
479479

480480
.. method:: HTTPResponse.getheaders()
@@ -578,7 +578,7 @@ Here is an example session that uses the ``HEAD`` method. Note that the
578578
>>> data == b''
579579
True
580580

581-
Here is an example session that shows how to ``POST`` requests::
581+
Here is an example session that uses the ``POST`` method::
582582

583583
>>> import http.client, urllib.parse
584584
>>> params = urllib.parse.urlencode({'@number': 12524, '@type': 'issue', '@action': 'show'})
@@ -594,14 +594,13 @@ Here is an example session that shows how to ``POST`` requests::
594594
b'Redirecting to <a href="https://bugs.python.org/issue12524">https://bugs.python.org/issue12524</a>'
595595
>>> conn.close()
596596

597-
Client side ``HTTP PUT`` requests are very similar to ``POST`` requests. The
598-
difference lies only the server side where HTTP server will allow resources to
599-
be created via ``PUT`` request. It should be noted that custom HTTP methods
597+
Client side HTTP ``PUT`` requests are very similar to ``POST`` requests. The
598+
difference lies only on the server side where HTTP servers will allow resources to
599+
be created via ``PUT`` requests. It should be noted that custom HTTP methods
600600
are also handled in :class:`urllib.request.Request` by setting the appropriate
601-
method attribute. Here is an example session that shows how to send a ``PUT``
602-
request using http.client::
601+
method attribute. Here is an example session that uses the ``PUT`` method::
603602

604-
>>> # This creates an HTTP message
603+
>>> # This creates an HTTP request
605604
>>> # with the content of BODY as the enclosed representation
606605
>>> # for the resource http://localhost:8080/file
607606
...

0 commit comments

Comments
 (0)
0