def result_ok(cl, response = None, content_type = "text/plain"): cl.send('HTTP/1.0 200 OK\r\nContent-type: ' + content_type + '\r\n\r\n') cl.send(response if response is not None else "Ok") cl.close() def result_notfound(cl, response = None): cl.send('HTTP/1.0 404 NotFound\r\nContent-type: text/plain\r\n\r\n') cl.send(response if response is not None else "Not Found") cl.close()