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
478f8291
Commit
478f8291
authored
Jan 18, 2019
by
Ashwin Ramaswami
Committed by
Brian Curtin
Jan 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-21257: document http.client.parse_headers (GH-11443)
Document http.client.parse_headers
parent
34de2d31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
Doc/library/http.client.rst
Doc/library/http.client.rst
+19
-0
Misc/NEWS.d/next/Documentation/2019-01-15-21-45-27.bpo-21257.U9LKkx.rst
...xt/Documentation/2019-01-15-21-45-27.bpo-21257.U9LKkx.rst
+1
-0
No files found.
Doc/library/http.client.rst
View file @
478f8291
...
...
@@ -115,6 +115,25 @@ The module provides the following classes:
The *strict* parameter was removed. HTTP 0.9 style "Simple Responses" are
no longer supported.
This module provides the following function:
.. function:: parse_headers(fp)
Parse the headers from a file pointer *fp* representing a HTTP
request/response. The file has to be a :class:`BufferedIOBase` reader
(i.e. not text) and must provide a valid :rfc:`2822` style header.
This function returns an instance of :class:`http.client.HTTPMessage`
that holds the header fields, but no payload
(the same as :attr:`HTTPResponse.msg`
and :attr:`http.server.BaseHTTPRequestHandler.headers`).
After returning, the file pointer *fp* is ready to read the HTTP body.
.. note::
:meth:`parse_headers` does not parse the start-line of a HTTP message;
it only parses the ``Name: value`` lines. The file has to be ready to
read these field lines, so the first line should already be consumed
before calling the function.
The following exceptions are raised as appropriate:
...
...
Misc/NEWS.d/next/Documentation/2019-01-15-21-45-27.bpo-21257.U9LKkx.rst
0 → 100644
View file @
478f8291
Document :func:`http.client.parse_headers`.
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