cpython: a912ca4f507b (original) (raw)
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -97,7 +97,6 @@ of which this module provides three diff
:mod:http.client
is used to parse the headers and it requires that the
HTTP request provide a valid :rfc:2822
style header.
-
.. attribute:: rfile
Contains an input stream, positioned at the start of the optional input
@@ -109,7 +108,7 @@ of which this module provides three diff
client. Proper adherence to the HTTP protocol must be used when writing to
this stream.
@@ -125,13 +124,10 @@ of which this module provides three diff .. attribute:: error_message_format
Specifies a format string for building an error response to the client. It[](#l1.24)
uses parenthesized, keyed format specifiers, so the format operand must be[](#l1.25)
a dictionary. The *code* key should be an integer, specifying the numeric[](#l1.26)
HTTP error code value. *message* should be a string containing a[](#l1.27)
(detailed) error message of what occurred, and *explain* should be an[](#l1.28)
explanation of the error code number. Default *message* and *explain*[](#l1.29)
values can found in the :attr:`responses` class variable.[](#l1.30)
Specifies a format string that should be used by :meth:`send_error` method[](#l1.31)
for building an error response to the client. The string is filled by[](#l1.32)
default with variables from :attr:`responses` based on the status code[](#l1.33)
that passed to :meth:`send_error`.[](#l1.34)
.. attribute:: error_content_type @@ -154,11 +150,11 @@ of which this module provides three diff .. attribute:: responses
This variable contains a mapping of error code integers to two-element tuples[](#l1.42)
This attribute contains a mapping of error code integers to two-element tuples[](#l1.43) containing a short and long message. For example, ``{code: (shortmessage,[](#l1.44) longmessage)}``. The *shortmessage* is usually used as the *message* key in an[](#l1.45)
error response, and *longmessage* as the *explain* key (see the[](#l1.46)
:attr:`error_message_format` class variable).[](#l1.47)
error response, and *longmessage* as the *explain* key. It is used by[](#l1.48)
:meth:`send_response_only` and :meth:`send_error` methods.[](#l1.49)
A :class:BaseHTTPRequestHandler
instance has the following methods:
@@ -191,9 +187,9 @@ of which this module provides three diff
specifies the HTTP error code, with message as an optional, short, human
readable description of the error. The explain argument can be used to
provide more detailed information about the error; it will be formatted
using the :attr:`error_message_format` class variable and emitted, after[](#l1.57)
using the :attr:`error_message_format` attribute and emitted, after[](#l1.58) a complete set of headers, as the response body. The :attr:`responses`[](#l1.59)
class variable holds the default values for *message* and *explain* that[](#l1.60)
attribute holds the default values for *message* and *explain* that[](#l1.61) will be used if no value is provided; for unknown codes the default value[](#l1.62) for both is the string ``???``.[](#l1.63)
@@ -201,7 +197,6 @@ of which this module provides three diff
The error response includes a Content-Length header.
Added the explain argument.
-
.. method:: send_response(code, message=None)
Adds a response header to the headers buffer and logs the accepted
@@ -217,7 +212,6 @@ of which this module provides three diff
Headers are stored to an internal buffer and :meth:end_headers
needs to be called explicitly.
-
.. method:: send_header(keyword, value)
Adds the HTTP header to an internal buffer which will be written to the
@@ -229,7 +223,6 @@ of which this module provides three diff
.. versionchanged:: 3.2
Headers are stored in an internal buffer.
-
.. method:: send_response_only(code, message=None)
Sends the response header only, used for the purposes when ``100
@@ -279,7 +272,7 @@ of which this module provides three diff
.. method:: version_string()
Returns the server software's version string. This is a combination of the
:attr:`server_version` and :attr:`sys_version` class variables.[](#l1.93)
:attr:`server_version` and :attr:`sys_version` attributes.[](#l1.94)