summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-05-09 15:25:02 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2011-05-09 15:25:02 (GMT)
commitc7ae19b6a7cf819d5646f2c88c5dd6e2c244939d (patch)
treef57fd821f8b18ada6e40a25e141d3cfa1eddda2a /Doc/library
parent87cf220972c9cb400ddcd577962883dcc5dca51a (diff)
downloadcpython-c7ae19b6a7cf819d5646f2c88c5dd6e2c244939d.zip
cpython-c7ae19b6a7cf819d5646f2c88c5dd6e2c244939d.tar.gz
cpython-c7ae19b6a7cf819d5646f2c88c5dd6e2c244939d.tar.bz2
Issue #3709: a flush_headers method to BaseHTTPRequestHandler which manages the
sending of headers to output stream and flushing the internal headers buffer. Patch contribution by Andrew Schaaf
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/http.server.rst27
1 files changed, 18 insertions, 9 deletions
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index e3a3a10..d9539f7 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -179,16 +179,17 @@ of which this module provides three different variants:
.. method:: send_response(code, message=None)
- Sends a response header and logs the accepted request. The HTTP response
- line is sent, followed by *Server* and *Date* headers. The values for
- these two headers are picked up from the :meth:`version_string` and
- :meth:`date_time_string` methods, respectively.
+ Adds a response header to the headers buffer and logs the accepted
+ request. The HTTP response line is sent, followed by *Server* and
+ *Date* headers. The values for these two headers are picked up from
+ the :meth:`version_string` and :meth:`date_time_string` methods,
+ respectively.
.. method:: send_header(keyword, value)
- Stores the HTTP header to an internal buffer which will be written to the
- output stream when :meth:`end_headers` method is invoked.
- *keyword* should specify the header keyword, with *value*
+ Adds the HTTP header to an internal buffer which will be written to the
+ output stream when either :meth:`end_headers` or :meth:`flush_headers`
+ is invoked. *keyword* should specify the header keyword, with *value*
specifying its value.
.. versionchanged:: 3.2 Storing the headers in an internal buffer
@@ -205,11 +206,19 @@ of which this module provides three different variants:
.. method:: end_headers()
- Write the buffered HTTP headers to the output stream and send a blank
- line, indicating the end of the HTTP headers in the response.
+ Adds a blank line
+ (indicating the end of the HTTP headers in the response)
+ to the headers buffer and calls :meth:`flush_headers()`
.. versionchanged:: 3.2 Writing the buffered headers to the output stream.
+ .. method:: flush_headers()
+
+ Finally send the headers to the output stream and flush the internal
+ headers buffer.
+
+ .. versionadded:: 3.3
+
.. method:: log_request(code='-', size='-')
Logs an accepted (successful) request. *code* should specify the numeric