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 my $parser = HTTP::Request::Params->new({
23 req => $http_request,
24 });
25
26 "req" - This required argument is either an "HTTP::Request" object or a
27 string containing an entier HTTP Request.
28
29 Incoming query parameters come from two places. The first place is the
30 "query" portion of the URL. Second is the content portion of an HTTP
31 request as is the case when parsing a POST request, for example.
32
33 params
34 my $params = $parser->params;
35
36 Returns a hash reference containing all the parameters. The keys in
37 this hash are the names of the parameters. Values are the values
38 associated with those parameters in the incoming query. For parameters
39 with multiple values, the value in this hash will be a list reference.
40 This is the same behaviour as the "CGI" module's "Vars()" function.
41
42 req
43 my $req_object = $parser->req;
44
45 Returns the "HTTP::Request" object.
46
47 mime
48 my $mime_object = $parser->mime;
49
50 Returns the "Email::MIME" object.
51
52 Now, you may be wondering why we're dealing with an "Email::MIME"
53 object. The answer is simple. It's an amazing parser for MIME
54 compliant messages, and RFC 822 compliant messages. When parsing
55 incoming POST data, especially file uploads, "Email::MIME" is the
56 perfect fit. It's fast and light.
57
59 "HTTP::Daemon", HTTP::Request, Email::MIME, CGI, perl.
60
62 Casey West, <casey@geeknest.com>. Ian Stuart, <Ian.Stuart@ed.ac.uk>.
63
65 Copyright (c) 2015 Casey West. All rights reserved.
66 This module is free software; you can redistribute it and/or modify it
67 under the same terms as Perl itself.
68
69
70
71perl v5.28.1 2015-08-11 HTTP::Request::Params(3)