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

_ClassType CGIHTTPRequestHandler

SocketServer.BaseRequestHandler --+            
                                  |            
  SocketServer.StreamRequestHandler --+        
                                      |        
  BaseHTTPServer.BaseHTTPRequestHandler --+    
                                          |    
  SimpleHTTPServer.SimpleHTTPRequestHandler --+
                                              |
                                             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.

Nested Classes [hide private]

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: MessageClass

Instance Methods [hide private]
 
do_POST(self)
Serve a POST request.
 
send_head(self)
Version of send_head that support CGI scripts
 
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.

Inherited from SimpleHTTPServer.SimpleHTTPRequestHandler: copyfile, do_GET, do_HEAD, guess_type, list_directory, translate_path

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: address_string, date_time_string, end_headers, handle, handle_one_request, log_date_time_string, log_error, log_message, log_request, parse_request, send_error, send_header, send_response, version_string

Inherited from SocketServer.StreamRequestHandler: finish, setup

Inherited from SocketServer.BaseRequestHandler: __init__

Class Variables [hide private]
  have_fork = True
  have_popen2 = True
  have_popen3 = True
  rbufsize = 0
  cgi_directories = ['/cgi-bin', '/htbin']

Inherited from SimpleHTTPServer.SimpleHTTPRequestHandler: extensions_map, server_version

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: error_message_format, monthname, protocol_version, responses, sys_version, weekdayname

Inherited from SocketServer.StreamRequestHandler: wbufsize

Method Details [hide private]

do_POST(self)

 

Serve a POST request.

This is only implemented for CGI scripts.

send_head(self)

 

Version of send_head that support CGI scripts

Overrides: SimpleHTTPServer.SimpleHTTPRequestHandler.send_head

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).