1Request(3) User Contributed Perl Documentation Request(3)
2
3
4
6 APR::Request - wrapper for libapreq2's module/handle API.
7
9 use APR::Request;
10
11 $req = APR::Request::Custom->handle($pool,
12 "foo=arg1&bar=arg2",
13 "apache=quux",
14 $parser, 1e6, $bb);
15 $param = $req->param("foo");
16 $cookie = $req->jar("apache");
17
19 The "APR::Request" module provides the base methods for interfacing
20 with libapreq2's module API. It also provides a few utility functions
21 and constants.
22
23 This manpage documents version 2.17 of the APR::Request,
24 APR::Request::Custom, APR::Request::Cookie::Table, and
25 APR::Request::Param::Table packages.
26
28 APR::Request::Custom - derived from APR::Request.
29
30 handle
31 APR::Request::Custom->handle($pool,
32 $query_string,
33 $cookie_header,
34 $parser,
35 $read_limit,
36 $brigade)
37
38 Creates a new APR::Request::Custom object. The $query_string and
39 $cookie_headers are immediately parsed into the "args" and "jar"
40 tables. The $parser is an APR::Request::Parser object which is invoked
41 when fetching "body" entries from the $brigade. The $read_limit
42 represents the maximum number of bytes this handle may feed into the
43 parser.
44
46 APR::Request
47
48 pool
49 $req->pool()
50
51 Returns the APR::Pool object associated to this handle.
52
53 bucket_alloc
54 $req->bucket_alloc()
55
56 Returns the APR::BucketAlloc object associated to this handle.
57
58 jar_status
59 $req->jar_status()
60
61 Returns the final status code of the handle's cookie header parser.
62
63 args_status
64 $req->args_status()
65
66 Returns the final status code of the handle's query-string parser.
67
68 body_status
69 $req->body_status()
70
71 Returns the final status code of the handle's body parser.
72
73 param_status
74 $req->param_status()
75
76 Returns "($req->args_status, $req->body_status)" in list context;
77 otherwise returns "$req->args_status || $req->body_status".
78
79 parse
80 $req->parse()
81
82 Parses the jar, args, and body tables. Returns "$req->jar_status,
83 $req->args_status, $req->body_status".
84
85 @status = $req->parse;
86 ok @status == 3;
87 ok $status[0] == $req->jar_status;
88 ok $status[1] == $req->args_status;
89 ok $status[2] == $req->body_status;
90
91 jar
92 $req->jar()
93 $req->jar($key)
94
95 With no arguments, this method returns a tied
96 APR::Request::Cookie::Table object (or undef if the "Cookie" header is
97 absent) in scalar context, or the names (in order, with repetitions) of
98 all the parsed cookies.
99
100 With the $key argument, in scalar context this method fetches the first
101 matching cookie. In list context it returns all matching cookies. The
102 returned cookies are the values as they appeared in the incoming