Package shttp :: Module http :: Class HTTPRequestHandler
[hide private]
[frames] | no frames]

Class HTTPRequestHandler

source code

SocketServer.BaseRequestHandler --+                
                                  |                
  SocketServer.StreamRequestHandler --+            
                                      |            
  BaseHTTPServer.BaseHTTPRequestHandler --+        
                                          |        
  SimpleHTTPServer.SimpleHTTPRequestHandler --+    
                                              |    
            CGIHTTPServer.CGIHTTPRequestHandler --+
                                                  |
                                                 HTTPRequestHandler

Nested Classes [hide private]

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: MessageClass

Instance Methods [hide private]
 
translate_path(self, path, root=None)
Translate a /-separated PATH to the local filename syntax.
source code
 
parse_request(self)
Parse a request (internal).
source code
 
setup(self) source code
 
handle(self)
Handle multiple requests if necessary.
source code
 
is_cgi(self)
Checks if the URI corresponds to a CGI or a Python Handler
source code
 
check_script_sanity(self, scriptname, scriptfile)
Returns True if running the script is OK, False otherwise
source code
 
address_string(self)
Return the client address formatted for logging.
source code
 
get_environ(self)
Execute a CGI script.
source code
 
run_cgi(self)
Execute a CGI script.
source code
 
log_message(self, format, *args)
Log an arbitrary message.
source code

Inherited from CGIHTTPServer.CGIHTTPRequestHandler: do_POST, is_executable, is_python, send_head

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

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

Inherited from SocketServer.StreamRequestHandler: finish

Inherited from SocketServer.BaseRequestHandler: __init__

Class Variables [hide private]

Inherited from CGIHTTPServer.CGIHTTPRequestHandler: cgi_directories, have_fork, have_popen2, have_popen3, rbufsize

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]

translate_path(self, path, root=None)

source code 

Translate a /-separated PATH to the local filename syntax.

Components that mean special things to the local file system (e.g. drive or directory names) are ignored. (XXX They should probably be diagnosed.)
Overrides: SimpleHTTPServer.SimpleHTTPRequestHandler.translate_path

parse_request(self)

source code 

Parse a request (internal).

The request should be stored in self.raw_requestline; the results are in self.command, self.path, self.request_version and self.headers.

Return True for success, False for failure; on failure, an error is sent back.
Overrides: BaseHTTPServer.BaseHTTPRequestHandler.parse_request
(inherited documentation)

setup(self)

source code 
Overrides: SocketServer.StreamRequestHandler.setup

handle(self)

source code 
Handle multiple requests if necessary.
Overrides: BaseHTTPServer.BaseHTTPRequestHandler.handle
(inherited documentation)

is_cgi(self)

source code 
Checks if the URI corresponds to a CGI or a Python Handler
Overrides: CGIHTTPServer.CGIHTTPRequestHandler.is_cgi

address_string(self)

source code 

Return the client address formatted for logging.

This version looks up the full hostname using gethostbyaddr(), and tries to find a name that contains at least one dot.
Overrides: BaseHTTPServer.BaseHTTPRequestHandler.address_string
(inherited documentation)

run_cgi(self)

source code 
Execute a CGI script.
Overrides: CGIHTTPServer.CGIHTTPRequestHandler.run_cgi

log_message(self, format, *args)

source code 

Log an arbitrary message.

This is used by all other logging functions. Override it if you have specific logging wishes.

The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring parameters, they should be specified as subsequent arguments (it's just like printf!).

The client host and current date/time are prefixed to every message.
Overrides: BaseHTTPServer.BaseHTTPRequestHandler.log_message
(inherited documentation)