WebKit.HTTPServer | index /usr/local/share/webware/WebKit/HTTPServer.py

Modules

``

BaseHTTPServer errno | os socket | time |

Classes

``

BaseHTTPServer.BaseHTTPRequestHandler(SocketServer.StreamRequestHandler)
  HTTPHandler
    HTTPAppServerHandler(WebKit.ThreadedAppServer.Handler, HTTPHandler)
WebKit.ThreadedAppServer.Handler
  HTTPAppServerHandler(WebKit.ThreadedAppServer.Handler, HTTPHandler)

class HTTPAppServerHandler(WebKit.ThreadedAppServer.Handler, HTTPHandler)
`` | `AppServer interface. Adapters HTTPHandler to fit with ThreadedAppServer's model of an adapter.`

Method resolution order:
  HTTPAppServerHandler
  WebKit.ThreadedAppServer.Handler
  HTTPHandler
  BaseHTTPServer.BaseHTTPRequestHandler
  SocketServer.StreamRequestHandler
  SocketServer.BaseRequestHandler

Methods defined here:

dispatchRawRequest(self, requestDict, streamOut)
  `Dispatch the request.`

doTransaction(self, env, input)
  `Process transaction.`

handleRequest(self)
  `Handle a request.`

Data and other attributes defined here:

protocolName = 'http'

settingPrefix = 'HTTP'

Methods inherited from WebKit.ThreadedAppServer.Handler:

__init__(self, server, serverAddress)
  `Create a new socket handler.
  Each handler is attached to a specific host and port,
  and of course to the AppServer.`

activate(self, sock, requestID)
  `Activate the handler for processing the request.
  `sock` is the incoming socket that this handler will work with,
  and `requestID` is a serial number unique for each request.
  This isn't where work gets done -- the handler is queued after this,
  and work is done when `handleRequest` is called.`

close(self)
  `Close the socket.
  Called when the handler is finished. Closes the socket and
  returns the handler to the pool of inactive handlers.`

endRequest(self, error=None)
  `Track end of a raw request.
  Subclasses can use and override this method.`

receiveDict(self)
  `Receive a dictionary from the socket.
  Utility function to receive a marshalled dictionary from the socket.
  Returns None if the request was empty.`

startRequest(self, requestDict=None)
  `Track start of a raw request.
  Subclasses can use and override this method.`

Methods inherited from HTTPHandler:

do_COPY = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_DELETE = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_GET = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_HEAD = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_MKCOL = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_MOVE = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_OPTIONS = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_POST = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_PROPFIND = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

do_PUT = handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

headersToEnviron(self, headers, env)
  `Convert headers to environment variables.
  Use a simple heuristic to convert all the headers to
  environmental variables.`

log_request(self, code='-', size='-')
  `Log an accepted request.
  Do nothing (use the LogActivity setting instead).`

processResponse(self, data)
  `Process response.
  Takes a string (like what a CGI script would print) and
  sends the actual HTTP response (response code, headers, body).`

Methods inherited from BaseHTTPServer.BaseHTTPRequestHandler:

address_string(self)
  `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.`

date_time_string(self, timestamp=None)
  `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.
  You normally don't need to override this method; see the class
  __doc__ string for information on how to handle specific HTTP
  commands such as GET and POST.`

log_date_time_string(self)
  `Return the current time formatted for logging.`

log_error(self, format, *args)
  `Log an error.
  This is called when a request cannot be fulfilled. By
  default it passes the message on to log_message().
  Arguments are the same as for log_message().
  XXX This should go to the separate error log.`

log_message(self, format, *args)
  `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.`

parse_request(self)
  `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.`

send_error(self, code, message=None)
  `Send and log an error reply.
  Arguments are the error code, and a detailed message.
  The detailed message defaults to the short entry matching the
  response code.
  This sends an error response (so it must be called before any
  output has been generated), logs the error, and finally sends
  a piece of HTML explaining the error to the user.`

send_header(self, keyword, value)
  `Send a MIME header.`

send_response(self, code, message=None)
  `Send the response header and log the response code.
  Also send two standard headers with the server software
  version and the current date.`

version_string(self)
  `Return the server software version string.`

Data and other attributes inherited from BaseHTTPServer.BaseHTTPRequestHandler:

MessageClass = <class mimetools.Message>

default_request_version = 'HTTP/0.9'

error_content_type = 'text/html'

error_message_format = '<head>\n<title>Error response</title>\n</head>\n<bo...ode explanation: %(code)s = %(explain)s.\n</body>\n'

monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

protocol_version = 'HTTP/1.0'

responses = {100: ('Continue', 'Request received, please continue'), 101: ('Switching Protocols', 'Switching to new protocol; obey Upgrade header'), 200: ('OK', 'Request fulfilled, document follows'), 201: ('Created', 'Document created, URL follows'), 202: ('Accepted', 'Request accepted, processing continues off-line'), 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), 204: ('No Content', 'Request fulfilled, nothing follows'), 205: ('Reset Content', 'Clear input form for further input.'), 206: ('Partial Content', 'Partial content follows.'), 300: ('Multiple Choices', 'Object has several resources -- see URI list'), ...}

server_version = 'BaseHTTP/0.3'

sys_version = 'Python/2.6.6'

weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

Methods inherited from SocketServer.StreamRequestHandler:

finish(self)

setup(self)

Data and other attributes inherited from SocketServer.StreamRequestHandler:

rbufsize = -1

wbufsize = 0

class HTTPHandler(BaseHTTPServer.BaseHTTPRequestHandler)
`` | `Handles incoming requests. Recreated with every request. Abstract base class.`

Method resolution order:
  HTTPHandler
  BaseHTTPServer.BaseHTTPRequestHandler
  SocketServer.StreamRequestHandler
  SocketServer.BaseRequestHandler

Methods defined here:

do_COPY = handleRequest(self)

do_DELETE = handleRequest(self)

do_GET = handleRequest(self)

do_HEAD = handleRequest(self)

do_MKCOL = handleRequest(self)

do_MOVE = handleRequest(self)

do_OPTIONS = handleRequest(self)

do_POST = handleRequest(self)

do_PROPFIND = handleRequest(self)

do_PUT = handleRequest(self)

handleRequest(self)
  `Handle a request.
  Actually performs the request, creating the environment and calling
  doTransaction(env, input) to perform the response.`

headersToEnviron(self, headers, env)
  `Convert headers to environment variables.
  Use a simple heuristic to convert all the headers to
  environmental variables.`

log_request(self, code='-', size='-')
  `Log an accepted request.
  Do nothing (use the LogActivity setting instead).`

processResponse(self, data)
  `Process response.
  Takes a string (like what a CGI script would print) and
  sends the actual HTTP response (response code, headers, body).`

Methods inherited from BaseHTTPServer.BaseHTTPRequestHandler:

address_string(self)
  `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.`

date_time_string(self, timestamp=None)
  `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.
  You normally don't need to override this method; see the class
  __doc__ string for information on how to handle specific HTTP
  commands such as GET and POST.`

log_date_time_string(self)
  `Return the current time formatted for logging.`

log_error(self, format, *args)
  `Log an error.
  This is called when a request cannot be fulfilled. By
  default it passes the message on to log_message().
  Arguments are the same as for log_message().
  XXX This should go to the separate error log.`

log_message(self, format, *args)
  `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.`

parse_request(self)
  `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.`

send_error(self, code, message=None)
  `Send and log an error reply.
  Arguments are the error code, and a detailed message.
  The detailed message defaults to the short entry matching the
  response code.
  This sends an error response (so it must be called before any
  output has been generated), logs the error, and finally sends
  a piece of HTML explaining the error to the user.`

send_header(self, keyword, value)
  `Send a MIME header.`

send_response(self, code, message=None)
  `Send the response header and log the response code.
  Also send two standard headers with the server software
  version and the current date.`

version_string(self)
  `Return the server software version string.`

Data and other attributes inherited from BaseHTTPServer.BaseHTTPRequestHandler:

MessageClass = <class mimetools.Message>

default_request_version = 'HTTP/0.9'

error_content_type = 'text/html'

error_message_format = '<head>\n<title>Error response</title>\n</head>\n<bo...ode explanation: %(code)s = %(explain)s.\n</body>\n'

monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

protocol_version = 'HTTP/1.0'

responses = {100: ('Continue', 'Request received, please continue'), 101: ('Switching Protocols', 'Switching to new protocol; obey Upgrade header'), 200: ('OK', 'Request fulfilled, document follows'), 201: ('Created', 'Document created, URL follows'), 202: ('Accepted', 'Request accepted, processing continues off-line'), 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), 204: ('No Content', 'Request fulfilled, nothing follows'), 205: ('Reset Content', 'Clear input form for further input.'), 206: ('Partial Content', 'Partial content follows.'), 300: ('Multiple Choices', 'Object has several resources -- see URI list'), ...}

server_version = 'BaseHTTP/0.3'

sys_version = 'Python/2.6.6'

weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

Methods inherited from SocketServer.StreamRequestHandler:

finish(self)

setup(self)

Data and other attributes inherited from SocketServer.StreamRequestHandler:

rbufsize = -1

wbufsize = 0

Methods inherited from SocketServer.BaseRequestHandler:

__init__(self, request, client_address, server)