in sample/topic/server.py [0:0]
def send_response(self, code, message=None):
"""
Send the response header and log the response code.
Also send two standard headers with the server software
version and the current date.
"""
if message is None:
if code in self.responses:
message = self.responses[code][0]
else:
message = u''
if self.request_version != 'HTTP/0.9':
self.wfile.write((u"%s %d %s\r\n" %
(self.protocol_version, code, message)).encode('utf-8'))
# print (self.protocol_version, code, message)
self.send_header('Server', self.version_string())
self.send_header('Date', self.date_time_string())