http.server.BaseHTTPRequestHandler.version_string()

version_string() Returns the server software’s version string. This is a combination of the server_version and sys_version attributes.

http.server.CGIHTTPRequestHandler

class http.server.CGIHTTPRequestHandler(request, client_address, server) This class is used to serve either files or output of CGI scripts from the current directory and below. Note that mapping HTTP hierarchic structure to local directory structure is exactly as in SimpleHTTPRequestHandler. Note CGI scripts run by the CGIHTTPRequestHandler class cannot execute redirects (HTTP code 302), because code 200 (script output follows) is sent prior to execution of the CGI script. This pre-empts th

http.server.HTTPServer

class http.server.HTTPServer(server_address, RequestHandlerClass) This class builds on the TCPServer class by storing the server address as instance variables named server_name and server_port. The server is accessible by the handler, typically through the handler’s server instance variable.

http.server.BaseHTTPRequestHandler.send_response_only()

send_response_only(code, message=None) Sends the response header only, used for the purposes when 100 Continue response is sent by the server to the client. The headers not buffered and sent directly the output stream.If the message is not specified, the HTTP message corresponding the response code is sent. New in version 3.2.

http.server.BaseHTTPRequestHandler.sys_version

sys_version Contains the Python system version, in a form usable by the version_string method and the server_version class variable. For example, 'Python/1.4'.

http.server.BaseHTTPRequestHandler.server_version

server_version Specifies the server software version. You may want to override this. The format is multiple whitespace-separated strings, where each string is of the form name[/version]. For example, 'BaseHTTP/0.2'.

http.server.BaseHTTPRequestHandler.send_header()

send_header(keyword, value) Adds the HTTP header to an internal buffer which will be written to the output stream when either end_headers() or flush_headers() is invoked. keyword should specify the header keyword, with value specifying its value. Note that, after the send_header calls are done, end_headers() MUST BE called in order to complete the operation. Changed in version 3.2: Headers are stored in an internal buffer.

http.server.BaseHTTPRequestHandler.send_error()

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 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 error_message_format attribute and emitted, after a complete set of headers, as the response body. The responses attribute holds the default values for mes

http.server.BaseHTTPRequestHandler.server

server Contains the server instance.

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 versio