Model HTTP request data.
This object provides access to request data. This includes, the
input headers, form data, server data, and cookies.
Request objects are created by the object publisher and will be
passed to published objects through the argument name, REQUEST.
The request object is a mapping object that represents a
collection of variable to value mappings. In addition, variables
are divided into four categories:
Environment variables
These variables include input headers, server data, and other
request-related data. The variable names are as specified
in the CGI
specification
Form data
These are data extracted from either a URL-encoded query
string or body, if present.
Cookies
These are the cookie data, if present.
Other
Data that may be set by an application object.
The form attribute of a request is actually a Field Storage
object. When file uploads are used, this provides a richer and
more complex interface than is provided by accessing form data as
items of the request. See the FieldStorage class documentation
for more details.
The request object may be used as a mapping object, in which case
values will be looked up in the order: environment variables,
other variables, form data, and then cookies.
Methods
|
|
|
|
__getitem__
|
__getitem__ (
self,
key,
default=_marker,
URLmatch=regex.compile( 'URL[0-9]+$' ),
BASEmatch=regex.compile( 'BASE[0-9]+$' ),
)
|
|
__init__
|
__init__ (
self,
stdin,
environ,
response,
clean=0,
)
|
|
__str__
|
__str__ ( self )
|
|
_authUserPW
|
_authUserPW ( self )
|
|
_resetURLS
|
_resetURLS ( self )
|
|
clone
|
clone ( self )
|
|
get
|
get (
self,
key,
default=None,
)
|
|
get_header
|
get_header (
self,
name,
default=None,
)
Return the named HTTP header, or an optional default
argument or None if the header is not found. Note that
both original and CGI-ified header names are recognized,
e.g. Content-Type , CONTENT_TYPE and HTTP_CONTENT_TYPE
should all return the Content-Type header, if available.
|
|
has_key
|
has_key ( self, key )
|
|
keys
|
keys ( self )
|
|
processInputs
|
processInputs (
self,
SEQUENCE=1,
DEFAULT=2,
RECORD=4,
RECORDS=8,
REC=12,
EMPTY=16,
CONVERTED=32,
hasattr=hasattr,
getattr=getattr,
setattr=setattr,
search_type=regex.compile( ':[a-zA-Z][a-zA-Z0-9_]+$' ),
rfind=string.rfind,
)
Process request inputs
We need to delay input parsing so that it is done under
publisher control for error handling purposes.
|
|
resolve_url
|
resolve_url ( self, url )
|
|
retry
|
retry ( self )
|
|
setServerURL
|
setServerURL (
self,
protocol=None,
hostname=None,
port=None,
)
Set the parts of generated URLs.
|
|
setVirtualRoot
|
setVirtualRoot (
self,
path,
hard=0,
)
Treat the current publishing object as a VirtualRoot
|
|
supports_retry
|
supports_retry ( self )
|
|