summaryrefslogtreecommitdiffstats
path: root/Doc/library/http.server.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-01-03 18:03:00 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-01-03 18:03:00 (GMT)
commita475a8d313805bb84affcba8da7c8e82319d0761 (patch)
tree182c364fb0546cb8d7f8441dcc48515a66699758 /Doc/library/http.server.rst
parentfa4e68d42582a0fb61baac98ac10b3fbf43f8751 (diff)
downloadcpython-a475a8d313805bb84affcba8da7c8e82319d0761.zip
cpython-a475a8d313805bb84affcba8da7c8e82319d0761.tar.gz
cpython-a475a8d313805bb84affcba8da7c8e82319d0761.tar.bz2
whatsnew: http.server send_error explain parameter.
Also rewrote the send_error description for clarity and correct English.
Diffstat (limited to 'Doc/library/http.server.rst')
-rw-r--r--Doc/library/http.server.rst15
1 files changed, 9 insertions, 6 deletions
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index 113ac44..0f7c8b3 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -116,7 +116,7 @@ of which this module provides three different variants:
HTTP error code value. *message* should be a string containing a
(detailed) error message of what occurred, and *explain* should be an
explanation of the error code number. Default *message* and *explain*
- values can found in the *responses* class variable.
+ values can found in the :attr:`responses` class variable.
.. attribute:: error_content_type
@@ -173,11 +173,14 @@ of which this module provides three different variants:
.. method:: send_error(code, message=None, explain=None)
Sends and logs a complete error reply to the client. The numeric *code*
- specifies the HTTP error code, with *message* as optional, more specific
- text, usually referring to short message response. The *explain*
- argument can be used to send a detailed information about the error in
- response content body. A complete set of headers is sent, followed by
- text composed using the :attr:`error_message_format` class variable.
+ 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
+ a complete set of headers, as the response body. The :attr:`responses`
+ class variable holds the default values for *message* and *explain* that
+ will be used if no value is provided; for unknown codes the default value
+ for both is the string ``???``.
.. versionchanged:: 3.4
The error response includes a Content-Length header.