Module BaseHTTPServer
HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts). It does, however, optionally implement HTTP/1.1
persistent connections, as of version 0.3.
Contents:
- BaseHTTPRequestHandler: HTTP request handler base class
- test: test function
XXX To do:
- log requests even later (to capture byte count)
- log user-agent header and other interesting goodies
- send error log to separate file
|
|
|
test(HandlerClass=<class BaseHTTPServer.BaseHTTPRequestHandler at 0x406f914c>,
ServerClass=<class BaseHTTPServer.HTTPServer at 0x406ee8cc>,
protocol=' HTTP/1.0 ' )
Test the HTTP request handler class. |
|
|
Imports:
sys,
time,
socket,
mimetools,
SocketServer
test(HandlerClass=<class BaseHTTPServer.BaseHTTPRequestHandler at 0x406f914c>,
ServerClass=<class BaseHTTPServer.HTTPServer at 0x406ee8cc>,
protocol=' HTTP/1.0 ' )
|
|
Test the HTTP request handler class.
This runs an HTTP server on port 8000 (or the first command line
argument).
|
DEFAULT_ERROR_MESSAGE
- Value:
''' <head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code %(code)d.
<p>Message: %(message)s.
<p>Error code explanation: %(code)s = %(explain)s.
...
|
|