HTTP::...:Params(3pm)
π HTTP::...:Params π
okay so bestie, welcome to HTTP::Request::Params β the manual page for the module that pulls GET/POST parameters out of HTTP requests. it lives in the User Contributed Perl Documentation section of the manual, and yes it's a 3pm page, we love a perl module page, no cap. π
β¨ NAME β¨
HTTP::Request::Params β Retrieve GET/POST Parameters from HTTP Requests π
β¨ SYNOPSIS β¨
okay so here's the whole vibe in four lines, she's literally that girl:
use HTTP::Request::Params;
my $http_request = read_request();
my $parse_params = HTTP::Request::Params->new({
req => $http_request,
});
my $params = $parse_params->params;
like... read the request, hand it over, get your params. iconic. π¦
β¨ DESCRIPTION β¨
this software does all the dirty work of parsing HTTP Requests to find incoming query parameters. not me volunteering to do the unglamorous stuff so you don't have to π that's main character energy fr fr.
πΈ new πΈ
my $parser = HTTP::Request::Params->new({
req => $http_request,
});
req β this required argument is either an HTTP::Request object or a string containing an entier HTTP Request. (yes, "entier", that's what it says, we keep the lore exactly as it is, bestie π)
so where do incoming query parameters even come from?? two places, babes. the first place is the query portion of the URL. the second is the content portion of an HTTP request, as is the case when parsing a POST request, for example. two sources, one slay. β¨
πΈ params πΈ
my $params = $parser->params;
returns a hash reference containing all the parameters. the keys in this hash are the names of the parameters, and the values are the values associated with those parameters in the incoming query. and if a parameter has multiple values?? then the value in this hash will be a list reference. this is the exact same behaviour as the CGI module's Vars() function. consistency queen π
πΈ req πΈ
my $req_object = $parser->req;
returns the HTTP::Request object. that's it, that's the whole function, short and sweet and we respect it π«Ά
πΈ mime πΈ
my $mime_object = $parser->mime;
returns the Email::MIME object.
now, you may be wondering why we're dealing with an Email::MIME object at all. the answer is simple, bestie. it's an amazing parser for MIME compliant messages, and RFC 822 compliant messages. when parsing incoming POST data, especially file uploads, Email::MIME is the perfect fit. it's fast and light. obsessed, honestly. π₯
β¨ SEE ALSO β¨
go read these too, iykyk:
HTTP::DaemonHTTP::RequestEmail::MIMECGIperl
β¨ AUTHOR β¨
Casey West, <casey@geeknest.com>. Ian Stuart, <Ian.Stuart@ed.ac.uk>. π
β¨ COPYRIGHT β¨
Copyright (c) 2015 Casey West. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
so basically: free software, same terms as Perl itself, redistribute and/or modify as you please. just don't come for Casey. periodt. π
and that's the whole page, bestie!! this was rendered for you by perl v5.34.0, dated 2022-06-14, and it's giving "User Contributed Perl Documentation" the whole way through. mwah, love u, go parse some requests ππβ¨
π¦ where this page comes from
- debian bookworm: libhttp-request-params-perl 1.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhttp-request-params-perl 1.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhttp-request-params-perl 1.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhttp-request-params-perl 1.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhttp-request-params-perl 1.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms