connection
object associated with this request. See
Connection Object below for details.
(Read-Only)
Range:
header.
(Read-Only)
table
object representing the headers to be sent to the
client.
table
object containing environment information typically usable for CGI.
You may have to call req.add_common_vars() first to fill in the information
you need.
table
object that could be used to store miscellaneous
general purpose info that lives for as long as the request lives. If
you need to pass data between handlers, it's better to simply add
members to the request object than to use notes.
def typehandler(req): if os.path.splitext(req.filename)[1] == ".py": req.handler = "mod_python" req.add_handler("PythonHandler", "mod_python.publisher") return apache.OK return apache.DECLINED
mp_finfo
, analogous to the
result of the POSIX stat function, describing the
file pointed to by the URI. The object provides the attributes
fname
, filetype
, valid
, protection
,
user
, group
, size
, inode
, device
,
nlink
, atime
, mtime
, ctime
and name
.
The attribute may be assigned to using the result of apache.stat()
.
For example:
if req.finfo.filetype == apache.APR_DIR: req.filename = posixpath.join(req.filename, 'index.html') req.finfo = apache.stat(req.filename, apache.APR_FINFO_MIN)
For backward compatability, the object can also be accessed as if it
were a tuple. The apache
module defines a set of FINFO_*
constants that should be used to access elements of this tuple.
user = req.finfo[apache.FINFO_USER]
(scheme, hostinfo, user, password, hostname, port, path, query, fragment)
.
The apache
module defines a set of URI_* constants that
should be used to access elements of this tuple. Example:
fname = req.parsed_uri[apache.URI_PATH]