File: pyapi-mprequest-mem.html

package info (click to toggle)
libapache2-mod-python 3.2.10-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,476 kB
  • ctags: 2,034
  • sloc: ansic: 5,218; python: 5,195; makefile: 282; sh: 270; lex: 246
file content (536 lines) | stat: -rw-r--r-- 16,436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="modpython.css" type='text/css'>
<link rel="first" href="modpython.html" title='Mod_python Manual'>
<link rel='contents' href='contents.html' title="Contents">
<link rel='index' href='genindex.html' title='Index'>
<link rel='last' href='about.html' title='About this document...'>
<link rel='help' href='about.html' title='About this document...'>
<LINK REL="prev" href="pyapi-mprequest-meth.html">
<LINK REL="parent" href="pyapi-mprequest.html">
<LINK REL="next" href="pyapi-mpconn.html">
<meta name='aesop' content='information'>
<META NAME="description" CONTENT="Request Members">
<META NAME="keywords" CONTENT="modpython">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<title>4.5.3.2 Request Members</title>
</head>
<body>
<DIV CLASS="navigation">
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><a rel="prev" title="4.5.3.1 Request Methods" 
  href="pyapi-mprequest-meth.html"><img src='previous.gif'
  border='0' height='32'  alt='Previous Page' width='32'></A></td>
<td><a rel="parent" title="4.5.3 Request Object&nbsp;" 
  href="pyapi-mprequest.html"><img src='up.gif'
  border='0' height='32'  alt='Up One Level' width='32'></A></td>
<td><a rel="next" title="4.5.4 Connection Object (mp_conn)&nbsp;" 
  href="pyapi-mpconn.html"><img src='next.gif'
  border='0' height='32'  alt='Next Page' width='32'></A></td>
<td align="center" width="100%">Mod_python Manual</td>
<td><a rel="contents" title="Table of Contents" 
  href="contents.html"><img src='contents.gif'
  border='0' height='32'  alt='Contents' width='32'></A></td>
<td><img src='blank.gif'
  border='0' height='32'  alt='' width='32'></td>
<td><a rel="index" title="Index" 
  href="genindex.html"><img src='index.gif'
  border='0' height='32'  alt='Index' width='32'></A></td>
</tr></table>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="pyapi-mprequest-meth.html">4.5.3.1 Request Methods</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="pyapi-mprequest.html">4.5.3 Request Object&nbsp;</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn)&nbsp;</A>
<br><hr>
</DIV>
<!--End of Navigation Panel-->

<H3><A NAME="SECTION006532000000000000000">&nbsp;</A>
<BR>
4.5.3.2 Request Members
</H3>

<P>
<dl><dt><b><a name="l2h-67"><tt class="member">connection</tt></a></b>
<dd>
  A <code>connection</code> object associated with this request. See
  Connection Object below for details.
  <i>(Read-Only)</i>
</dl>

<P>
<dl><dt><b><a name="l2h-68"><tt class="member">server</tt></a></b>
<dd>
  A server object associate with this request. See Server Object below
  for details.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-69"><tt class="member">next</tt></a></b>
<dd>
  If this is an internal redirect, the request object we redirect to. 
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-70"><tt class="member">prev</tt></a></b>
<dd>
  If this is an internal redirect, the request object we redirect from.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-71"><tt class="member">main</tt></a></b>
<dd>
  If this is a sub-request, pointer to the main request. 
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-72"><tt class="member">the_request</tt></a></b>
<dd>
  String containing the first line of the request.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-73"><tt class="member">assbackwards</tt></a></b>
<dd>
  Indicates an HTTP/0.9 ``simple'' request. This means that the
  response will contain no headers, only the body. Although this
  exists for backwards compatibility with obsolescent browsers, some
  people have figred out that setting assbackwards to 1 can be a
  useful technique when including part of the response from an
  internal redirect to avoid headers being sent.
</dl>

<P>
<dl><dt><b><a name="l2h-74"><tt class="member">proxyreq</tt></a></b>
<dd>
  A proxy request: one of <tt class="constant">apache.PROXYREQ_*</tt> values.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-75"><tt class="member">header_only</tt></a></b>
<dd>
  A boolean value indicating HEAD request, as opposed to GET. 
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-76"><tt class="member">protocol</tt></a></b>
<dd>
  Protocol, as given by the client, or "<tt class="samp">HTTP/0.9</tt>". Same as CGI <a class="envvar" name="l2h-124">SERVER_PROTOCOL</a>.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-77"><tt class="member">proto_num</tt></a></b>
<dd>
  Integer. Number version of protocol; 1.1 = 1001 
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-78"><tt class="member">hostname</tt></a></b>
<dd>
  String. Host, as set by full URI or Host: header.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-79"><tt class="member">request_time</tt></a></b>
<dd>
  A long integer. When request started.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-80"><tt class="member">status_line</tt></a></b>
<dd>
  Status line. E.g. "<tt class="samp">200 OK</tt>". 
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-81"><tt class="member">status</tt></a></b>
<dd>
  Status. One of <tt class="constant">apache.HTTP_*</tt> values.
</dl>

<P>
<dl><dt><b><a name="l2h-82"><tt class="member">method</tt></a></b>
<dd>
  A string containing the method - 'GET', 'HEAD', 'POST', etc.
  Same as CGI <a class="envvar" name="l2h-125">REQUEST_METHOD</a>.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-83"><tt class="member">method_number</tt></a></b>
<dd>
  Integer containing the method number.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-84"><tt class="member">allowed</tt></a></b>
<dd>
  Integer. A bitvector of the allowed methods. Used to construct the
  Allowed: header when responding with
  <tt class="constant">HTTP_METHOD_NOT_ALLOWED</tt> or
  <tt class="constant">HTTP_NOT_IMPLEMENTED</tt>. This field is for Apache's internal
  use, to set the Allowed: methods use <tt class="method">req.allow_methods()</tt>
  method, described in section <A href="pyapi-mprequest-meth.html#pyapi-mprequest-meth">4.5.3</A>. 
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-85"><tt class="member">allowed_xmethods</tt></a></b>
<dd>
  Tuple. Allowed extension methods.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-86"><tt class="member">allowed_methods</tt></a></b>
<dd>
  Tuple. List of allowed methods. Used in relation with
  <tt class="constant">METHOD_NOT_ALLOWED</tt>. This member can be modified via <tt class="method">req.allow_methods()</tt> 
  described in section <A href="pyapi-mprequest-meth.html#pyapi-mprequest-meth">4.5.3</A>.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-87"><tt class="member">sent_bodyct</tt></a></b>
<dd>
  Integer. Byte count in stream is for body. (?)
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-88"><tt class="member">bytes_sent</tt></a></b>
<dd>
  Long integer. Number of bytes sent.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-89"><tt class="member">mtime</tt></a></b>
<dd>
  Long integer. Time the resource was last modified.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-90"><tt class="member">chunked</tt></a></b>
<dd>
  Boolean value indicating when sending chunked transfer-coding.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-91"><tt class="member">range</tt></a></b>
<dd>
  String. The <code>Range:</code> header.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-92"><tt class="member">clength</tt></a></b>
<dd>
  Long integer. The ``real'' content length.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-93"><tt class="member">remaining</tt></a></b>
<dd>
  Long integer. Bytes left to read. (Only makes sense inside a read
  operation.)
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-94"><tt class="member">read_length</tt></a></b>
<dd>
  Long integer. Number of bytes read.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-95"><tt class="member">read_body</tt></a></b>
<dd>
  Integer. How the request body should be read.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-96"><tt class="member">read_chunked</tt></a></b>
<dd>
  Boolean. Read chunked transfer coding.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-97"><tt class="member">expecting_100</tt></a></b>
<dd>
  Boolean. Is client waiting for a 100 (<tt class="constant">HTTP_CONTINUE</tt>) response.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-98"><tt class="member">headers_in</tt></a></b>
<dd>
  A table object containing headers sent by the client.
</dl>

<P>
<dl><dt><b><a name="l2h-99"><tt class="member">headers_out</tt></a></b>
<dd>
  A <code>table</code> object representing the headers to be sent to the
  client. 
</dl>

<P>
<dl><dt><b><a name="l2h-100"><tt class="member">err_headers_out</tt></a></b>
<dd>
  These headers get send with the error response, instead of
  headers_out.
</dl>

<P>
<dl><dt><b><a name="l2h-101"><tt class="member">subprocess_env</tt></a></b>
<dd>
  A <code>table</code> object containing environment information typically usable for CGI.
  You may have to call <tt class="member">req.add_common_vars()</tt> first to fill in the information
  you need.
</dl>

<P>
<dl><dt><b><a name="l2h-102"><tt class="member">notes</tt></a></b>
<dd>
  A <code>table</code> 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 <tt class="member">notes</tt>.
</dl>

<P>
<dl><dt><b><a name="l2h-103"><tt class="member">phase</tt></a></b>
<dd>
  The phase currently being being processed, e.g. "<tt class="samp">PythonHandler</tt>".
  <i>(Read-Only)</i>
</dl>

<P>
<dl><dt><b><a name="l2h-104"><tt class="member">interpreter</tt></a></b>
<dd>
  The name of the subinterpreter under which we're running.
  <i>(Read-Only)</i>
</dl>

<P>
<dl><dt><b><a name="l2h-105"><tt class="member">content_type</tt></a></b>
<dd>
  String. The content type. Mod_python maintains an internal flag
  (<tt class="member">req._content_type_set</tt>) to keep track of whether
  <tt class="member">content_type</tt> was set manually from within Python. The
  publisher handler uses this flag in the following way: when
  <tt class="member">content_type</tt> isn't explicitly set, it attempts to guess the
  content type by examining the first few bytes of the output.
</dl>

<P>
<dl><dt><b><a name="l2h-106"><tt class="member">content_languages</tt></a></b>
<dd>
  Tuple. List of strings representing the content languages. 
</dl>

<P>
<dl><dt><b><a name="l2h-107"><tt class="member">handler</tt></a></b>
<dd>
  The name of the handler currently being processed. This is the handler
  set by mod_mime, not the mod_python handler. In most cases it will be
  ""<tt class="samp">mod_python</tt>". <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-108"><tt class="member">content_encoding</tt></a></b>
<dd>
  String. Content encoding.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-109"><tt class="member">vlist_validator</tt></a></b>
<dd>
  Integer. Variant list validator (if negotiated).
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-110"><tt class="member">user</tt></a></b>
<dd>
  If an authentication check is made, this will hold the user
  name. Same as CGI <a class="envvar" name="l2h-126">REMOTE_USER</a>.
  <i>(Read-Only</i>)
  <div class="note"><b class="label">Note:</b>
<tt class="method">req.get_basic_auth_pw()</tt> must be called prior to using this value.
  </div>
</dl>

<P>
<dl><dt><b><a name="l2h-111"><tt class="member">ap_auth_type</tt></a></b>
<dd>
  Authentication type. Same as CGI <a class="envvar" name="l2h-127">AUTH_TYPE</a>.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-112"><tt class="member">no_cache</tt></a></b>
<dd>
  Boolean. No cache if true.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-113"><tt class="member">no_local_copy</tt></a></b>
<dd>
  Boolean. No local copy exists.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-114"><tt class="member">unparsed_uri</tt></a></b>
<dd>
  The URI without any parsing performed.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-115"><tt class="member">uri</tt></a></b>
<dd>
  The path portion of the URI.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-116"><tt class="member">filename</tt></a></b>
<dd>
  String. File name being requested.
</dl>

<P>
<dl><dt><b><a name="l2h-117"><tt class="member">canonical_filename</tt></a></b>
<dd>
  String. The true filename (<tt class="member">req.filename</tt> is canonicalized if
  they don't match).  <i>(Read-Only)</i>
</dl>

<P>
<dl><dt><b><a name="l2h-118"><tt class="member">path_info</tt></a></b>
<dd>
  String. What follows after the file name, but is before query args, if
  anything. Same as CGI <a class="envvar" name="l2h-128">PATH_INFO</a>.
</dl>

<P>
<dl><dt><b><a name="l2h-119"><tt class="member">args</tt></a></b>
<dd>
  String. Same as CGI <a class="envvar" name="l2h-129">QUERY_ARGS</a>.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-120"><tt class="member">finfo</tt></a></b>
<dd>
  Tuple. A file information structure, analogous to POSIX stat,
  describing the file pointed to by the URI.  <code>(mode, ino,
    dev, nlink, uid, gid, size, atime, mtime, ctime, fname,
    name)</code>. The <code>apache</code> module defines a set of <tt class="constant">FINFO_*</tt>
  constants that should be used to access elements of this
  tuple. Example:
  <div class="verbatim"><pre>
fname = req.finfo[apache.FINFO_FNAME]
</pre></div>
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-121"><tt class="member">parsed_uri</tt></a></b>
<dd>
  Tuple. The URI broken down into pieces.
  <code>(scheme, hostinfo, user, password, hostname, port, path, query, fragment)</code>. 
  The <code>apache</code> module defines a set of <tt class="constant">URI_*</tt> constants that
  should be used to access elements of this tuple. Example:
  <div class="verbatim"><pre>
fname = req.parsed_uri[apache.URI_PATH]
</pre></div>
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-122"><tt class="member">used_path_info</tt></a></b>
<dd>
  Flag to accept or reject path_info on current request.
  <i>(Read-Only</i>)
</dl>

<P>
<dl><dt><b><a name="l2h-123"><tt class="member">eos_sent</tt></a></b>
<dd>
  Boolean. EOS bucket sent.
  <i>(Read-Only</i>)
</dl>

<P>

<DIV CLASS="navigation">
<p><hr>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><a rel="prev" title="4.5.3.1 Request Methods" 
  rel="prev" title="4.5.3.1 Request Methods" 
  href="pyapi-mprequest-meth.html"><img src='previous.gif'
  border='0' height='32'  alt='Previous Page' width='32'></A></td>
<td><a rel="parent" title="4.5.3 Request Object&nbsp;" 
  rel="parent" title="4.5.3 Request Object&nbsp;" 
  href="pyapi-mprequest.html"><img src='up.gif'
  border='0' height='32'  alt='Up One Level' width='32'></A></td>
<td><a rel="next" title="4.5.4 Connection Object (mp_conn)&nbsp;" 
  rel="next" title="4.5.4 Connection Object (mp_conn)&nbsp;" 
  href="pyapi-mpconn.html"><img src='next.gif'
  border='0' height='32'  alt='Next Page' width='32'></A></td>
<td align="center" width="100%">Mod_python Manual</td>
<td><a rel="contents" title="Table of Contents" 
  rel="contents" title="Table of Contents" 
  href="contents.html"><img src='contents.gif'
  border='0' height='32'  alt='Contents' width='32'></A></td>
<td><img src='blank.gif'
  border='0' height='32'  alt='' width='32'></td>
<td><a rel="index" title="Index" 
  rel="index" title="Index" 
  href="genindex.html"><img src='index.gif'
  border='0' height='32'  alt='Index' width='32'></A></td>
</tr></table>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="pyapi-mprequest-meth.html">4.5.3.1 Request Methods</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="pyapi-mprequest.html">4.5.3 Request Object&nbsp;</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn)&nbsp;</A>
<hr>
<span class="release-info">Release 3.2.10, documentation updated on July 19, 2006.</span>
</DIV>
<!--End of Navigation Panel-->

</BODY>
</HTML>