~ubuntu-branches/ubuntu/warty/libapache2-mod-python/warty

« back to all changes in this revision

Viewing changes to doc-html/pyapi-mprequest-mem.html

  • Committer: Bazaar Package Importer
  • Author(s): Thom May
  • Date: 2004-09-06 20:27:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040906202757-yzpyu1bcabgpjtiu
Tags: upstream-3.1.3
ImportĀ upstreamĀ versionĀ 3.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
2
<html>
 
3
<head>
 
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">
 
16
</head>
 
17
<body>
 
18
<DIV CLASS="navigation">
 
19
<table align="center" width="100%" cellpadding="0" cellspacing="2">
 
20
<tr>
 
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>
 
40
</tr></table>
 
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&nbsp;</A>
 
43
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn)&nbsp;</A>
 
44
<br><hr>
 
45
</DIV>
 
46
<!--End of Navigation Panel-->
 
47
 
 
48
<H3><A NAME="SECTION006532000000000000000">&nbsp;</A>
 
49
<BR>
 
50
4.5.3.2 Request Members
 
51
</H3>
 
52
 
 
53
<P>
 
54
<dl><dt><b><a name="l2h-50"><tt class="member">connection</tt></a></b>
 
55
<dd>
 
56
  A <code>connection</code> object associated with this request. See
 
57
  Connection Object below for details.
 
58
  <i>(Read-Only)</i>
 
59
</dl>
 
60
 
 
61
<P>
 
62
<dl><dt><b><a name="l2h-51"><tt class="member">server</tt></a></b>
 
63
<dd>
 
64
  A server object associate with this request. See Server Object below
 
65
  for details.
 
66
  <i>(Read-Only</i>)
 
67
</dl>
 
68
 
 
69
<P>
 
70
<dl><dt><b><a name="l2h-52"><tt class="member">next</tt></a></b>
 
71
<dd>
 
72
  If this is an internal redirect, the request object we redirect to. 
 
73
  <i>(Read-Only</i>)
 
74
</dl>
 
75
 
 
76
<P>
 
77
<dl><dt><b><a name="l2h-53"><tt class="member">prev</tt></a></b>
 
78
<dd>
 
79
  If this is an internal redirect, the request object we redirect from.
 
80
  <i>(Read-Only</i>)
 
81
</dl>
 
82
 
 
83
<P>
 
84
<dl><dt><b><a name="l2h-54"><tt class="member">main</tt></a></b>
 
85
<dd>
 
86
  If this is a sub-request, pointer to the main request. 
 
87
  <i>(Read-Only</i>)
 
88
</dl>
 
89
 
 
90
<P>
 
91
<dl><dt><b><a name="l2h-55"><tt class="member">the_request</tt></a></b>
 
92
<dd>
 
93
  String containing the first line of the request.
 
94
  <i>(Read-Only</i>)
 
95
</dl>
 
96
 
 
97
<P>
 
98
<dl><dt><b><a name="l2h-56"><tt class="member">assbackwards</tt></a></b>
 
99
<dd>
 
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.
 
106
</dl>
 
107
 
 
108
<P>
 
109
<dl><dt><b><a name="l2h-57"><tt class="member">proxyreq</tt></a></b>
 
110
<dd>
 
111
  A proxy request: one of <tt class="constant">apache.PROXYREQ_*</tt> values.
 
112
  <i>(Read-Only</i>)
 
113
</dl>
 
114
 
 
115
<P>
 
116
<dl><dt><b><a name="l2h-58"><tt class="member">header_only</tt></a></b>
 
117
<dd>
 
118
  A boolean value indicating HEAD request, as opposed to GET. 
 
119
  <i>(Read-Only</i>)
 
120
</dl>
 
121
 
 
122
<P>
 
123
<dl><dt><b><a name="l2h-59"><tt class="member">protocol</tt></a></b>
 
124
<dd>
 
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>.
 
126
  <i>(Read-Only</i>)
 
127
</dl>
 
128
 
 
129
<P>
 
130
<dl><dt><b><a name="l2h-60"><tt class="member">proto_num</tt></a></b>
 
131
<dd>
 
132
  Integer. Number version of protocol; 1.1 = 1001 
 
133
  <i>(Read-Only</i>)
 
134
</dl>
 
135
 
 
136
<P>
 
137
<dl><dt><b><a name="l2h-61"><tt class="member">hostname</tt></a></b>
 
138
<dd>
 
139
  String. Host, as set by full URI or Host: header.
 
140
  <i>(Read-Only</i>)
 
141
</dl>
 
142
 
 
143
<P>
 
144
<dl><dt><b><a name="l2h-62"><tt class="member">request_time</tt></a></b>
 
145
<dd>
 
146
  A long integer. When request started.
 
147
  <i>(Read-Only</i>)
 
148
</dl>
 
149
 
 
150
<P>
 
151
<dl><dt><b><a name="l2h-63"><tt class="member">status_line</tt></a></b>
 
152
<dd>
 
153
  Status line. E.g. "<tt class="samp">200 OK</tt>". 
 
154
  <i>(Read-Only</i>)
 
155
</dl>
 
156
 
 
157
<P>
 
158
<dl><dt><b><a name="l2h-64"><tt class="member">status</tt></a></b>
 
159
<dd>
 
160
  Status. One of <tt class="constant">apache.HTTP_*</tt> values.
 
161
</dl>
 
162
 
 
163
<P>
 
164
<dl><dt><b><a name="l2h-65"><tt class="member">method</tt></a></b>
 
165
<dd>
 
166
  A string containing the method - 'GET', 'HEAD', 'POST', etc.
 
167
  Same as CGI <a class="envvar" name="l2h-107">REQUEST_METHOD</a>.
 
168
  <i>(Read-Only</i>)
 
169
</dl>
 
170
 
 
171
<P>
 
172
<dl><dt><b><a name="l2h-66"><tt class="member">method_number</tt></a></b>
 
173
<dd>
 
174
  Integer containing the method number.
 
175
  <i>(Read-Only</i>)
 
176
</dl>
 
177
 
 
178
<P>
 
179
<dl><dt><b><a name="l2h-67"><tt class="member">allowed</tt></a></b>
 
180
<dd>
 
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>. 
 
187
  <i>(Read-Only</i>)
 
188
</dl>
 
189
 
 
190
<P>
 
191
<dl><dt><b><a name="l2h-68"><tt class="member">allowed_xmethods</tt></a></b>
 
192
<dd>
 
193
  Tuple. Allowed extension methods.
 
194
  <i>(Read-Only</i>)
 
195
</dl>
 
196
 
 
197
<P>
 
198
<dl><dt><b><a name="l2h-69"><tt class="member">allowed_methods</tt></a></b>
 
199
<dd>
 
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>.
 
203
  <i>(Read-Only</i>)
 
204
</dl>
 
205
 
 
206
<P>
 
207
<dl><dt><b><a name="l2h-70"><tt class="member">sent_bodyct</tt></a></b>
 
208
<dd>
 
209
  Integer. Byte count in stream is for body. (?)
 
210
  <i>(Read-Only</i>)
 
211
</dl>
 
212
 
 
213
<P>
 
214
<dl><dt><b><a name="l2h-71"><tt class="member">bytes_sent</tt></a></b>
 
215
<dd>
 
216
  Long integer. Number of bytes sent.
 
217
  <i>(Read-Only</i>)
 
218
</dl>
 
219
 
 
220
<P>
 
221
<dl><dt><b><a name="l2h-72"><tt class="member">mtime</tt></a></b>
 
222
<dd>
 
223
  Long integer. Time the resource was last modified.
 
224
  <i>(Read-Only</i>)
 
225
</dl>
 
226
 
 
227
<P>
 
228
<dl><dt><b><a name="l2h-73"><tt class="member">chunked</tt></a></b>
 
229
<dd>
 
230
  Boolean value indicating when sending chunked transfer-coding.
 
231
  <i>(Read-Only</i>)
 
232
</dl>
 
233
 
 
234
<P>
 
235
<dl><dt><b><a name="l2h-74"><tt class="member">range</tt></a></b>
 
236
<dd>
 
237
  String. The <code>Range:</code> header.
 
238
  <i>(Read-Only</i>)
 
239
</dl>
 
240
 
 
241
<P>
 
242
<dl><dt><b><a name="l2h-75"><tt class="member">clength</tt></a></b>
 
243
<dd>
 
244
  Long integer. The ``real'' content length.
 
245
  <i>(Read-Only</i>)
 
246
</dl>
 
247
 
 
248
<P>
 
249
<dl><dt><b><a name="l2h-76"><tt class="member">remaining</tt></a></b>
 
250
<dd>
 
251
  Long integer. Bytes left to read. (Only makes sense inside a read
 
252
  operation.)
 
253
  <i>(Read-Only</i>)
 
254
</dl>
 
255
 
 
256
<P>
 
257
<dl><dt><b><a name="l2h-77"><tt class="member">read_length</tt></a></b>
 
258
<dd>
 
259
  Long integer. Number of bytes read.
 
260
  <i>(Read-Only</i>)
 
261
</dl>
 
262
 
 
263
<P>
 
264
<dl><dt><b><a name="l2h-78"><tt class="member">read_body</tt></a></b>
 
265
<dd>
 
266
  Integer. How the request body should be read.
 
267
  <i>(Read-Only</i>)
 
268
</dl>
 
269
 
 
270
<P>
 
271
<dl><dt><b><a name="l2h-79"><tt class="member">read_chunked</tt></a></b>
 
272
<dd>
 
273
  Boolean. Read chunked transfer coding.
 
274
  <i>(Read-Only</i>)
 
275
</dl>
 
276
 
 
277
<P>
 
278
<dl><dt><b><a name="l2h-80"><tt class="member">expecting_100</tt></a></b>
 
279
<dd>
 
280
  Boolean. Is client waiting for a 100 (<tt class="constant">HTTP_CONTINUE</tt>) response.
 
281
  <i>(Read-Only</i>)
 
282
</dl>
 
283
 
 
284
<P>
 
285
<dl><dt><b><a name="l2h-81"><tt class="member">headers_in</tt></a></b>
 
286
<dd>
 
287
  A table object containing headers sent by the client.
 
288
</dl>
 
289
 
 
290
<P>
 
291
<dl><dt><b><a name="l2h-82"><tt class="member">headers_out</tt></a></b>
 
292
<dd>
 
293
  A <code>table</code> object representing the headers to be sent to the
 
294
  client. 
 
295
</dl>
 
296
 
 
297
<P>
 
298
<dl><dt><b><a name="l2h-83"><tt class="member">err_headers_out</tt></a></b>
 
299
<dd>
 
300
  These headers get send with the error response, instead of
 
301
  headers_out.
 
302
</dl>
 
303
 
 
304
<P>
 
305
<dl><dt><b><a name="l2h-84"><tt class="member">subprocess_env</tt></a></b>
 
306
<dd>
 
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
 
309
  you need.
 
310
</dl>
 
311
 
 
312
<P>
 
313
<dl><dt><b><a name="l2h-85"><tt class="member">notes</tt></a></b>
 
314
<dd>
 
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>.
 
319
</dl>
 
320
 
 
321
<P>
 
322
<dl><dt><b><a name="l2h-86"><tt class="member">phase</tt></a></b>
 
323
<dd>
 
324
  The phase currently being being processed, e.g. "<tt class="samp">PythonHandler</tt>".
 
325
  <i>(Read-Only)</i>
 
326
</dl>
 
327
 
 
328
<P>
 
329
<dl><dt><b><a name="l2h-87"><tt class="member">interpreter</tt></a></b>
 
330
<dd>
 
331
  The name of the subinterpreter under which we're running.
 
332
  <i>(Read-Only)</i>
 
333
</dl>
 
334
 
 
335
<P>
 
336
<dl><dt><b><a name="l2h-88"><tt class="member">content_type</tt></a></b>
 
337
<dd>
 
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.
 
344
</dl>
 
345
 
 
346
<P>
 
347
<dl><dt><b><a name="l2h-89"><tt class="member">handler</tt></a></b>
 
348
<dd>
 
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>)
 
352
</dl>
 
353
 
 
354
<P>
 
355
<dl><dt><b><a name="l2h-90"><tt class="member">content_encoding</tt></a></b>
 
356
<dd>
 
357
  String. Content encoding.
 
358
  <i>(Read-Only</i>)
 
359
</dl>
 
360
 
 
361
<P>
 
362
<dl><dt><b><a name="l2h-91"><tt class="member">vlist_validator</tt></a></b>
 
363
<dd>
 
364
  Integer. Variant list validator (if negotiated).
 
365
  <i>(Read-Only</i>)
 
366
</dl>
 
367
 
 
368
<P>
 
369
<dl><dt><b><a name="l2h-92"><tt class="member">user</tt></a></b>
 
370
<dd>
 
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>.
 
373
  <i>(Read-Only</i>)
 
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.
 
376
  </div>
 
377
</dl>
 
378
 
 
379
<P>
 
380
<dl><dt><b><a name="l2h-93"><tt class="member">ap_auth_type</tt></a></b>
 
381
<dd>
 
382
  Authentication type. Same as CGI <a class="envvar" name="l2h-109">AUTH_TYPE</a>.
 
383
  <i>(Read-Only</i>)
 
384
</dl>
 
385
 
 
386
<P>
 
387
<dl><dt><b><a name="l2h-94"><tt class="member">no_cache</tt></a></b>
 
388
<dd>
 
389
  Boolean. No cache if true.
 
390
  <i>(Read-Only</i>)
 
391
</dl>
 
392
 
 
393
<P>
 
394
<dl><dt><b><a name="l2h-95"><tt class="member">no_local_copy</tt></a></b>
 
395
<dd>
 
396
  Boolean. No local copy exists.
 
397
  <i>(Read-Only</i>)
 
398
</dl>
 
399
 
 
400
<P>
 
401
<dl><dt><b><a name="l2h-96"><tt class="member">unparsed_uri</tt></a></b>
 
402
<dd>
 
403
  The URI without any parsing performed.
 
404
  <i>(Read-Only</i>)
 
405
</dl>
 
406
 
 
407
<P>
 
408
<dl><dt><b><a name="l2h-97"><tt class="member">uri</tt></a></b>
 
409
<dd>
 
410
  The path portion of the URI.
 
411
  <i>(Read-Only</i>)
 
412
</dl>
 
413
 
 
414
<P>
 
415
<dl><dt><b><a name="l2h-98"><tt class="member">filename</tt></a></b>
 
416
<dd>
 
417
  String. File name being requested.
 
418
</dl>
 
419
 
 
420
<P>
 
421
<dl><dt><b><a name="l2h-99"><tt class="member">canonical_filename</tt></a></b>
 
422
<dd>
 
423
  String. The true filename (<tt class="member">req.filename</tt> is canonicalized if
 
424
  they don't match).  <i>(Read-Only)</i>
 
425
</dl>
 
426
 
 
427
<P>
 
428
<dl><dt><b><a name="l2h-100"><tt class="member">path_info</tt></a></b>
 
429
<dd>
 
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>.
 
432
  <i>(Read-Only</i>)
 
433
</dl>
 
434
 
 
435
<P>
 
436
<dl><dt><b><a name="l2h-101"><tt class="member">args</tt></a></b>
 
437
<dd>
 
438
  String. Same as CGI <a class="envvar" name="l2h-111">QUERY_ARGS</a>.
 
439
  <i>(Read-Only</i>)
 
440
</dl>
 
441
 
 
442
<P>
 
443
<dl><dt><b><a name="l2h-102"><tt class="member">finfo</tt></a></b>
 
444
<dd>
 
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
 
450
  tuple. Example:
 
451
  <dl><dd><pre class="verbatim">
 
452
fname = req.finfo[apache.FINFO_FNAME]
 
453
</pre></dl>
 
454
  <i>(Read-Only</i>)
 
455
</dl>
 
456
 
 
457
<P>
 
458
<dl><dt><b><a name="l2h-103"><tt class="member">parsed_uri</tt></a></b>
 
459
<dd>
 
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]
 
466
</pre></dl>
 
467
  <i>(Read-Only</i>)
 
468
</dl>
 
469
 
 
470
<P>
 
471
<dl><dt><b><a name="l2h-104"><tt class="member">used_path_info</tt></a></b>
 
472
<dd>
 
473
  Flag to accept or reject path_info on current request.
 
474
  <i>(Read-Only</i>)
 
475
</dl>
 
476
 
 
477
<P>
 
478
<dl><dt><b><a name="l2h-105"><tt class="member">eos_sent</tt></a></b>
 
479
<dd>
 
480
  Boolean. EOS bucket sent.
 
481
  <i>(Read-Only</i>)
 
482
</dl>
 
483
 
 
484
<P>
 
485
 
 
486
<DIV CLASS="navigation">
 
487
<p><hr>
 
488
<table align="center" width="100%" cellpadding="0" cellspacing="2">
 
489
<tr>
 
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>
 
509
</tr></table>
 
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&nbsp;</A>
 
512
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn)&nbsp;</A>
 
513
<hr>
 
514
<span class="release-info">Release 3.1.3, documentation updated on February 17, 2004.</span>
 
515
</DIV>
 
516
<!--End of Navigation Panel-->
 
517
 
 
518
</BODY>
 
519
</HTML>