1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<title>4.5.3.2 Request Members</title>
5
<META NAME="description" CONTENT="4.5.3.2 Request Members">
6
<META NAME="keywords" CONTENT="modpython">
7
<META NAME="resource-type" CONTENT="document">
8
<META NAME="distribution" CONTENT="global">
9
<link rel="STYLESHEET" href="modpython.css">
10
<link rel="first" href="modpython.html">
11
<link rel="contents" href="contents.html" title="Contents">
12
<link rel="index" href="genindex.html" title="Index">
13
<LINK REL="previous" href="pyapi-mprequest-meth.html">
14
<LINK REL="up" href="pyapi-mprequest.html">
15
<LINK REL="next" href="pyapi-mpconn.html">
18
<DIV CLASS="navigation">
19
<table align="center" width="100%" cellpadding="0" cellspacing="2">
21
<td><A href="pyapi-mprequest-meth.html"><img src="icons/previous.gif"
22
border="0" height="32"
23
alt="Previous Page" width="32"></A></td>
24
<td><A href="pyapi-mprequest.html"><img src="icons/up.gif"
25
border="0" height="32"
26
alt="Up One Level" width="32"></A></td>
27
<td><A href="pyapi-mpconn.html"><img src="icons/next.gif"
28
border="0" height="32"
29
alt="Next Page" width="32"></A></td>
30
<td align="center" width="100%">Mod_python Manual</td>
31
<td><A href="contents.html"><img src="icons/contents.gif"
32
border="0" height="32"
33
alt="Contents" width="32"></A></td>
34
<td><img src="icons/blank.gif"
35
border="0" height="32"
36
alt="" width="32"></td>
37
<td><A href="genindex.html"><img src="icons/index.gif"
38
border="0" height="32"
39
alt="Index" width="32"></A></td>
41
<b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-mprequest-meth.html">4.5.3.1 Request Methods</A>
42
<b class="navlabel">Up:</b> <a class="sectref" href="pyapi-mprequest.html">4.5.3 Request Object </A>
43
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn) </A>
46
<!--End of Navigation Panel-->
48
<H3><A NAME="SECTION006532000000000000000"> </A>
50
4.5.3.2 Request Members
54
<dl><dt><b><a name="l2h-50"><tt class="member">connection</tt></a></b>
56
A <code>connection</code> object associated with this request. See
57
Connection Object below for details.
62
<dl><dt><b><a name="l2h-51"><tt class="member">server</tt></a></b>
64
A server object associate with this request. See Server Object below
70
<dl><dt><b><a name="l2h-52"><tt class="member">next</tt></a></b>
72
If this is an internal redirect, the request object we redirect to.
77
<dl><dt><b><a name="l2h-53"><tt class="member">prev</tt></a></b>
79
If this is an internal redirect, the request object we redirect from.
84
<dl><dt><b><a name="l2h-54"><tt class="member">main</tt></a></b>
86
If this is a sub-request, pointer to the main request.
91
<dl><dt><b><a name="l2h-55"><tt class="member">the_request</tt></a></b>
93
String containing the first line of the request.
98
<dl><dt><b><a name="l2h-56"><tt class="member">assbackwards</tt></a></b>
100
Indicates an HTTP/0.9 ``simple'' request. This means that the
101
response will contain no headers, only the body. Although this
102
exists for backwards compatibility with obsolescent browsers, some
103
people have figred out that setting assbackwards to 1 can be a
104
useful technique when including part of the response from an
105
internal redirect to avoid headers being sent.
109
<dl><dt><b><a name="l2h-57"><tt class="member">proxyreq</tt></a></b>
111
A proxy request: one of <tt class="constant">apache.PROXYREQ_*</tt> values.
116
<dl><dt><b><a name="l2h-58"><tt class="member">header_only</tt></a></b>
118
A boolean value indicating HEAD request, as opposed to GET.
123
<dl><dt><b><a name="l2h-59"><tt class="member">protocol</tt></a></b>
125
Protocol, as given by the client, or "<tt class="samp">HTTP/0.9</tt>". Same as CGI <a class="envvar" name="l2h-106">SERVER_PROTOCOL</a>.
130
<dl><dt><b><a name="l2h-60"><tt class="member">proto_num</tt></a></b>
132
Integer. Number version of protocol; 1.1 = 1001
137
<dl><dt><b><a name="l2h-61"><tt class="member">hostname</tt></a></b>
139
String. Host, as set by full URI or Host: header.
144
<dl><dt><b><a name="l2h-62"><tt class="member">request_time</tt></a></b>
146
A long integer. When request started.
151
<dl><dt><b><a name="l2h-63"><tt class="member">status_line</tt></a></b>
153
Status line. E.g. "<tt class="samp">200 OK</tt>".
158
<dl><dt><b><a name="l2h-64"><tt class="member">status</tt></a></b>
160
Status. One of <tt class="constant">apache.HTTP_*</tt> values.
164
<dl><dt><b><a name="l2h-65"><tt class="member">method</tt></a></b>
166
A string containing the method - 'GET', 'HEAD', 'POST', etc.
167
Same as CGI <a class="envvar" name="l2h-107">REQUEST_METHOD</a>.
172
<dl><dt><b><a name="l2h-66"><tt class="member">method_number</tt></a></b>
174
Integer containing the method number.
179
<dl><dt><b><a name="l2h-67"><tt class="member">allowed</tt></a></b>
181
Integer. A bitvector of the allowed methods. Used to construct the
182
Allowed: header when responding with
183
<tt class="constant">HTTP_METHOD_NOT_ALLOWED</tt> or
184
<tt class="constant">HTTP_NOT_IMPLEMENTED</tt>. This field is for Apache's internal
185
use, to set the Allowed: methods use <tt class="method">req.allow_methods()</tt>
186
method, described in section <A href="pyapi-mprequest-meth.html#pyapi-mprequest-meth">4.5.3</A>.
191
<dl><dt><b><a name="l2h-68"><tt class="member">allowed_xmethods</tt></a></b>
193
Tuple. Allowed extension methods.
198
<dl><dt><b><a name="l2h-69"><tt class="member">allowed_methods</tt></a></b>
200
Tuple. List of allowed methods. Used in relation with
201
<tt class="constant">METHOD_NOT_ALLOWED</tt>. This member can be modified via <tt class="method">req.allow_methods()</tt>
202
described in section <A href="pyapi-mprequest-meth.html#pyapi-mprequest-meth">4.5.3</A>.
207
<dl><dt><b><a name="l2h-70"><tt class="member">sent_bodyct</tt></a></b>
209
Integer. Byte count in stream is for body. (?)
214
<dl><dt><b><a name="l2h-71"><tt class="member">bytes_sent</tt></a></b>
216
Long integer. Number of bytes sent.
221
<dl><dt><b><a name="l2h-72"><tt class="member">mtime</tt></a></b>
223
Long integer. Time the resource was last modified.
228
<dl><dt><b><a name="l2h-73"><tt class="member">chunked</tt></a></b>
230
Boolean value indicating when sending chunked transfer-coding.
235
<dl><dt><b><a name="l2h-74"><tt class="member">range</tt></a></b>
237
String. The <code>Range:</code> header.
242
<dl><dt><b><a name="l2h-75"><tt class="member">clength</tt></a></b>
244
Long integer. The ``real'' content length.
249
<dl><dt><b><a name="l2h-76"><tt class="member">remaining</tt></a></b>
251
Long integer. Bytes left to read. (Only makes sense inside a read
257
<dl><dt><b><a name="l2h-77"><tt class="member">read_length</tt></a></b>
259
Long integer. Number of bytes read.
264
<dl><dt><b><a name="l2h-78"><tt class="member">read_body</tt></a></b>
266
Integer. How the request body should be read.
271
<dl><dt><b><a name="l2h-79"><tt class="member">read_chunked</tt></a></b>
273
Boolean. Read chunked transfer coding.
278
<dl><dt><b><a name="l2h-80"><tt class="member">expecting_100</tt></a></b>
280
Boolean. Is client waiting for a 100 (<tt class="constant">HTTP_CONTINUE</tt>) response.
285
<dl><dt><b><a name="l2h-81"><tt class="member">headers_in</tt></a></b>
287
A table object containing headers sent by the client.
291
<dl><dt><b><a name="l2h-82"><tt class="member">headers_out</tt></a></b>
293
A <code>table</code> object representing the headers to be sent to the
298
<dl><dt><b><a name="l2h-83"><tt class="member">err_headers_out</tt></a></b>
300
These headers get send with the error response, instead of
305
<dl><dt><b><a name="l2h-84"><tt class="member">subprocess_env</tt></a></b>
307
A <code>table</code> object containing environment information typically usable for CGI.
308
You may have to call <tt class="member">req.add_common_vars()</tt> first to fill in the information
313
<dl><dt><b><a name="l2h-85"><tt class="member">notes</tt></a></b>
315
A <code>table</code> object that could be used to store miscellaneous
316
general purpose info that lives for as long as the request lives. If
317
you need to pass data between handlers, it's better to simply add
318
members to the request object than to use <tt class="member">notes</tt>.
322
<dl><dt><b><a name="l2h-86"><tt class="member">phase</tt></a></b>
324
The phase currently being being processed, e.g. "<tt class="samp">PythonHandler</tt>".
329
<dl><dt><b><a name="l2h-87"><tt class="member">interpreter</tt></a></b>
331
The name of the subinterpreter under which we're running.
336
<dl><dt><b><a name="l2h-88"><tt class="member">content_type</tt></a></b>
338
String. The content type. Mod_python maintains an internal flag
339
(<tt class="member">req._content_type_set</tt>) to keep track of whether
340
<tt class="member">content_type</tt> was set manually from within Python. The
341
publisher handler uses this flag in the following way: when
342
<tt class="member">content_type</tt> isn't explicitly set, it attempts to guess the
343
content type by examining the first few bytes of the output.
347
<dl><dt><b><a name="l2h-89"><tt class="member">handler</tt></a></b>
349
The name of the handler currently being processed. This is the handler
350
set by mod_mime, not the mod_python handler. In most cases it will be
351
""<tt class="samp">mod_python</tt>". <i>(Read-Only</i>)
355
<dl><dt><b><a name="l2h-90"><tt class="member">content_encoding</tt></a></b>
357
String. Content encoding.
362
<dl><dt><b><a name="l2h-91"><tt class="member">vlist_validator</tt></a></b>
364
Integer. Variant list validator (if negotiated).
369
<dl><dt><b><a name="l2h-92"><tt class="member">user</tt></a></b>
371
If an authentication check is made, this will hold the user
372
name. Same as CGI <a class="envvar" name="l2h-108">REMOTE_USER</a>.
374
<div class="note"><b class="label">Note:</b>
375
<tt class="method">req.get_basic_auth_pw()</tt> must be called prior to using this value.
380
<dl><dt><b><a name="l2h-93"><tt class="member">ap_auth_type</tt></a></b>
382
Authentication type. Same as CGI <a class="envvar" name="l2h-109">AUTH_TYPE</a>.
387
<dl><dt><b><a name="l2h-94"><tt class="member">no_cache</tt></a></b>
389
Boolean. No cache if true.
394
<dl><dt><b><a name="l2h-95"><tt class="member">no_local_copy</tt></a></b>
396
Boolean. No local copy exists.
401
<dl><dt><b><a name="l2h-96"><tt class="member">unparsed_uri</tt></a></b>
403
The URI without any parsing performed.
408
<dl><dt><b><a name="l2h-97"><tt class="member">uri</tt></a></b>
410
The path portion of the URI.
415
<dl><dt><b><a name="l2h-98"><tt class="member">filename</tt></a></b>
417
String. File name being requested.
421
<dl><dt><b><a name="l2h-99"><tt class="member">canonical_filename</tt></a></b>
423
String. The true filename (<tt class="member">req.filename</tt> is canonicalized if
424
they don't match). <i>(Read-Only)</i>
428
<dl><dt><b><a name="l2h-100"><tt class="member">path_info</tt></a></b>
430
String. What follows after the file name, but is before query args, if
431
anything. Same as CGI <a class="envvar" name="l2h-110">PATH_INFO</a>.
436
<dl><dt><b><a name="l2h-101"><tt class="member">args</tt></a></b>
438
String. Same as CGI <a class="envvar" name="l2h-111">QUERY_ARGS</a>.
443
<dl><dt><b><a name="l2h-102"><tt class="member">finfo</tt></a></b>
445
Tuple. A file information structure, analogous to POSIX stat,
446
describing the file pointed to by the URI. <code>(mode, ino,
447
dev, nlink, uid, gid, size, atime, mtime, ctime, fname,
448
name)</code>. The <code>apache</code> module defines a set of <tt class="constant">FINFO_*</tt>
449
constants that should be used to access elements of this
451
<dl><dd><pre class="verbatim">
452
fname = req.finfo[apache.FINFO_FNAME]
458
<dl><dt><b><a name="l2h-103"><tt class="member">parsed_uri</tt></a></b>
460
Tuple. The URI broken down into pieces.
461
<code>(scheme, hostinfo, user, password, hostname, port, path, query, fragment)</code>.
462
The <code>apache</code> module defines a set of <tt class="constant">URI_*</tt> constants that
463
should be used to access elements of this tuple. Example:
464
<dl><dd><pre class="verbatim">
465
fname = req.parsed_uri[apache.URI_PATH]
471
<dl><dt><b><a name="l2h-104"><tt class="member">used_path_info</tt></a></b>
473
Flag to accept or reject path_info on current request.
478
<dl><dt><b><a name="l2h-105"><tt class="member">eos_sent</tt></a></b>
480
Boolean. EOS bucket sent.
486
<DIV CLASS="navigation">
488
<table align="center" width="100%" cellpadding="0" cellspacing="2">
490
<td><A href="pyapi-mprequest-meth.html"><img src="icons/previous.gif"
491
border="0" height="32"
492
alt="Previous Page" width="32"></A></td>
493
<td><A href="pyapi-mprequest.html"><img src="icons/up.gif"
494
border="0" height="32"
495
alt="Up One Level" width="32"></A></td>
496
<td><A href="pyapi-mpconn.html"><img src="icons/next.gif"
497
border="0" height="32"
498
alt="Next Page" width="32"></A></td>
499
<td align="center" width="100%">Mod_python Manual</td>
500
<td><A href="contents.html"><img src="icons/contents.gif"
501
border="0" height="32"
502
alt="Contents" width="32"></A></td>
503
<td><img src="icons/blank.gif"
504
border="0" height="32"
505
alt="" width="32"></td>
506
<td><A href="genindex.html"><img src="icons/index.gif"
507
border="0" height="32"
508
alt="Index" width="32"></A></td>
510
<b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-mprequest-meth.html">4.5.3.1 Request Methods</A>
511
<b class="navlabel">Up:</b> <a class="sectref" href="pyapi-mprequest.html">4.5.3 Request Object </A>
512
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn) </A>
514
<span class="release-info">Release 3.1.3, documentation updated on February 17, 2004.</span>
516
<!--End of Navigation Panel-->