PyDocs

Nav

Internet Protocols and Support

BaseHTTPRequestHandler.send_error

  • BaseHTTPRequestHandler.send_error(code, message=None, explain=None)
Send and log an error reply.

Arguments are
* code:    an HTTP error code
           3 digits
* message: a simple optional 1 line reason phrase.
           *( HTAB / SP / VCHAR / %x80-FF )
           defaults to short entry matching the response code
* explain: a detailed message defaults to the long entry
           matching the response code.

This sends an error response (so it must be called before any
output has been generated), logs the error, and finally sends
a piece of HTML explaining the error to the user.
Changed in 3.4
  • 3.4: The error response includes a Content-Length header. Added the explain argument.
0 Examples
No examples for http.server/BaseHTTPRequestHandler.send_error.
See Also
No see-alsos for http.server/BaseHTTPRequestHandler.send_error
0 Notes
No notes for BaseHTTPRequestHandler.send_error