API for a simple WSGI web framework
This class provides a basic web development framework that should work with any WSGI implementation.
The wsgiAdaptor object provides a basic web development environment within an WSGI server implementation.
requestHandler (request)
. The requestHandler method must be multi-thread safe and return no value. The requestHandler is passed a Request object which contains details of the request, and provides methods to return content to the client.The method that the WSGI implementation should call.
An instance of this class is passed to the application's requsetHandler
method for every request made of the application. If no "sendX" method is called before the handler returns then an Internal Server Error is sent to the client. The sendX methods can be called multiple times with only the last method called taking effect.
Returns a FieldStorage instance containing the GET or POST variables (see the Python standard libraries CGI module for more information).
Returns the session associated with this client. The session is a Mapping type (e.g. dictionary). Values added to the session will automatically be saved into the session. Be aware that as the size of the session increases the time taken to load and save the session will grow.
The username of the authenticated user, or None if the user provided no username.
The password used by the user to authenticate, None if no authentication is provided.
Returns the stream that applications errors should be written to.
Return the relative path (still URL escaped) that was passed to the application.
Returns the part of the URL up to the parameters (e.g http://server.com/scriptName.py).
Set the content to be sent to the client once the application returns. If the content is not plain text then the contentType should be specified as the second parameter.
Prompt the user for a username/password for the given realm.
Send a 303 HTTP redirect to the newDestination.
Set the response and content to be sent to the client once the application returns. The responseStr should be the HTTP response string, e.g. "500 Internal Error".
Sets the content and contentType to be sent to the client based on the contents of a file for the given path. The path should be URL escaped. rootDir is the directory that the path is relative too, taking the current working directory if none is provided.
If the path reaches outside of the rootDir (e.g. a path of '../../etc/passwd') then an IOError is thrown. No other security checking is performed.
The full list of my published Software
Made with PubTal 3.5
Copyright 2021 Colin StewartEmail: colin at owlfish.com