1HTTP::Request::Params(3U)ser Contributed Perl DocumentatiHoTnTP::Request::Params(3)
2
3
4
6 HTTP::Request::Params - Retrieve GET/POST Parameters from HTTP Requests
7
9 use HTTP::Request::Params;
10
11 my $http_request = read_request();
12 my $parse_params = HTTP::Request::Params->new({
13 req => $http_request,
14 });
15 my $params = $parse_params->params;
16
18 This software does all the dirty work of parsing HTTP Requests to find
19 incoming query parameters.
20
21 new
22
23 my $parser = HTTP::Request::Params->new({
24 req => $http_request,
25 });
26
27 "req" - This required argument is either an "HTTP::Request" object or a
28 string containing an entier HTTP Request.
29
30 Incoming query parameters come from two places. The first place is the
31 "query" portion of the URL. Second is the content portion of an HTTP
32 request as is the case when parsing a POST request, for example.
33
34 params
35
36 my $params = $parser->params;
37
38 Returns a hash reference containing all the parameters. The keys in
39 this hash are the names of the parameters. Values are the values asso‐
40 ciated with those parameters in the incoming query. For parameters with
41 multiple values, the value in this hash will be a list reference. This
42 is the same behaviour as the "CGI" module's "Vars()" function.
43
44 req
45
46 my $req_object = $parser->req;
47
48 Returns the "HTTP::Request" object.
49
50 mime
51
52 my $mime_object = $parser->mime;
53
54 Returns the "Email::MIME" object.
55
56 Now, you may be wondering why we're dealing with an "Email::MIME"
57 object. The answer is simple. It's an amazing parser for MIME compli‐
58 ant messages, and RFC 822 compliant messages. When parsing incoming
59 POST data, especially file uploads, "Email::MIME" is the perfect fit.
60 It's fast and light.
61
63 "HTTP::Daemon", HTTP::Request, Email::MIME, CGI, perl.
64
66 Casey West, <casey@geeknest.com>.
67
69 Copyright (c) 2005 Casey West. All rights reserved.
70 This module is free software; you can redistribute it and/or modify it
71 under the same terms as Perl itself.
72
73
74
75perl v5.8.8 2005-01-12 HTTP::Request::Params(3)