5.2.3 pse.plugins.request -- information about the current request

The pse.plugins.request module provides you with information about the current request being processed.

CGI
A dictionary containing all the values you would see as environment variables in a CGI program. In addition to the variables in the Common Gateway Interface specification, some apache-specific variables are also available. See the apache documentation for details.

args
The arguments passed in the URL as part of the request. This is the same as pse.plugins.request.CGI['HTTP_QUERY_STRING'].

content
The content file contains the raw HTTP POST data, if any, from the client request. This can be used for applications that require access to the raw HTTP POST data, such as XML-RPC.

New in version 3.0.

id
The unique identifier apache assigns to each request. If the client has HTTP Keep-Alive capability, then this identifier may be the same for multiple requests.

Note: If using Apache 1.3, the mod_unique_id module must be loaded and active. If this module is not present, PSE will attempt to assign a unique identifier for the request, but multiple requests through the same connection using HTTP Keep-Alive will all receive different identifiers.

form
A dictionary of form variables submitted to the page, by GET and/or POST methods. Each key in the dictionary is from the name of a form element from the calling script, and the value is either a string, list or file object. What kind of object is used is dependent on the nature of the form elements used.

If there is only one form element with the same name, and it only has one value submitted, then the value is a string. Actually, this is a subclass of str, called PSEstr, which can be used as a normal Python str object in every way. It has the additional properties str and list, which return the string value as an actual string and a singleton list, respectively.

If there are multiple elements with the same name or a single element with multiple values, then the value is a list. Actually, this is a subclass of list, called PSElist, which can be used as a normal list object in every way. It has the additional propertes str and list, which return the first element of the list as a string (or '' of the list length is 0) and a copy of the PSElist as an actual list, respectively.

If the form encoding was multipart/form-data, and the form element was a file, then an open file is returned. Actually, this is a file-like object, called PSEfile, which can be used as a normal file object in every way. It has additional properties as follows. The filename property that is the file name from the form, which is also returned by the str property. The list property returns an iterator for the file, which can be used like a list, but does not read the entire file into memory at once.

The form attribute differs from the normal cgi.FieldStorage object in that values are automatically extracted and collected from the different Field objects. Also, blank values are always preserved, which result in empty strings.

By default form will never raise a KeyError for accessing an undefined key. Instead, it will return an empty string. However, the has_key function will still work as expected, returning False if the key was not defined in the form. You can change this behavior by setting FormKeyError to True in the pse.conf file.

Changed in version 3.0.

method
The method used for the request, such as ``GET'' or ``POST.'' This is the same as pse.plugins.request.CGI['REQUEST_METHOD'].

mtime
The modification time of the resource being accessed as a long integer.

path_info
The information the appears after the path of the URI, but before the arguments of a the requested URI. This is the same as pse.plugins.request.CGI['PATH_INFO'].

protocol
The protocol being used for the request as a string. For example, 'HTTP/1.1'.

uri
The path-only portion of the URI being requested.

url
The entire URI that was requested, including any path information and arguments.