http.server.BaseHTTPRequestHandler.send_response()

send_response(code, message=None)

Adds a response header to the headers buffer and logs the accepted request. The HTTP response line is written to the internal buffer, followed by Server and Date headers. The values for these two headers are picked up from the version_string() and date_time_string() methods, respectively. If the server does not intend to send any other headers using the send_header() method, then send_response() should be followed by an end_headers() call.

Changed in version 3.3: Headers are stored to an internal buffer and end_headers() needs to be called explicitly.

doc_python
2016-10-07 17:34:16
Comments
Leave a Comment

Please login to continue.