Module CGIHTTPServer :: Class CGIHTTPRequestHandler
[show private | hide private]
[frames | no frames]

Class CGIHTTPRequestHandler

BaseRequestHandler --+            
                     |            
  StreamRequestHandler --+        
                         |        
    BaseHTTPRequestHandler --+    
                             |    
      SimpleHTTPRequestHandler --+
                                 |
                                CGIHTTPRequestHandler

Known Subclasses:
CGIHTTPRequestHandler

Complete HTTP server with GET, HEAD and POST commands.

GET and HEAD also support running CGI scripts.

The POST command is *only* implemented for CGI scripts.
Method Summary
  do_POST(self)
Serve a POST request.
  is_cgi(self)
Test whether self.path corresponds to a CGI script.
  is_executable(self, path)
Test whether argument path is an executable file.
  is_python(self, path)
Test whether argument path is a Python script.
  run_cgi(self)
Execute a CGI script.
  send_head(self)
Version of send_head that support CGI scripts
    Inherited from SimpleHTTPRequestHandler
  copyfile(self, source, outputfile)
Copy all data between two file objects.
  do_GET(self)
Serve a GET request.
  do_HEAD(self)
Serve a HEAD request.
  guess_type(self, path)
Guess the type of a file.
  list_directory(self, path)
Helper to produce a directory listing (absent index.html).
  translate_path(self, path)
Translate a /-separated PATH to the local filename syntax.
    Inherited from BaseHTTPRequestHandler
  address_string(self)
Return the client address formatted for logging.
  date_time_string(self)
Return the current date and time formatted for a message header.
  end_headers(self)
Send the blank line ending the MIME headers.
  handle(self)
Handle multiple requests if necessary.
  handle_one_request(self)
Handle a single HTTP request.
  log_date_time_string(self)
Return the current time formatted for logging.
  log_error(self, *args)
Log an error.
  log_message(self, format, *args)
Log an arbitrary message.
  log_request(self, code, size)
Log an accepted request.
  parse_request(self)
Parse a request (internal).
  send_error(self, code, message)
Send and log an error reply.
  send_header(self, keyword, value)
Send a MIME header.
  send_response(self, code, message)
Send the response header and log the response code.
  version_string(self)
Return the server software version string.
    Inherited from StreamRequestHandler
  finish(self)
  setup(self)
    Inherited from BaseRequestHandler
  __init__(self, request, client_address, server)

Class Variable Summary
list cgi_directories = ['/cgi-bin', '/htbin']
bool have_fork = False
bool have_popen2 = True
bool have_popen3 = True
int rbufsize = 0                                                                     
    Inherited from SimpleHTTPRequestHandler
dict extensions_map = {'': 'application/octet-stream', '.obj'...
str server_version = 'SimpleHTTP/0.6'
    Inherited from BaseHTTPRequestHandler
str error_message_format = '<head>\n<title>Error response</t...
list monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'J...
str protocol_version = 'HTTP/1.0'
dict responses = {400: ('Bad request', 'Bad request syntax or...
str sys_version = 'Python/2.3.4'
list weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',...
    Inherited from StreamRequestHandler
int wbufsize = 0                                                                     

Method Details

do_POST(self)

Serve a POST request.

This is only implemented for CGI scripts.

is_cgi(self)

Test whether self.path corresponds to a CGI script.

Return a tuple (dir, rest) if self.path requires running a CGI script, None if not. Note that rest begins with a slash if it is not empty.

The default implementation tests whether the path begins with one of the strings in the list self.cgi_directories (and the next character is a '/' or the end of the string).

is_executable(self, path)

Test whether argument path is an executable file.

is_python(self, path)

Test whether argument path is a Python script.

run_cgi(self)

Execute a CGI script.

send_head(self)

Version of send_head that support CGI scripts
Overrides:
SimpleHTTPServer.SimpleHTTPRequestHandler.send_head

Class Variable Details

cgi_directories

Type:
list
Value:
['/cgi-bin', '/htbin']                                                 

have_fork

Type:
bool
Value:
False                                                                  

have_popen2

Type:
bool
Value:
True                                                                   

have_popen3

Type:
bool
Value:
True                                                                   

rbufsize

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Mon Aug 02 01:07:41 2004 http://epydoc.sf.net