DTA::CAB::Server::HTTP::Handler::CGI - DTA::CAB::Server::HTTP::Handler class: CGI form processing
##========================================================================
## PRELIMINARIES
use DTA::CAB::Server::HTTP::Handler::CGI;
##========================================================================
## Methods
$h = $class_or_obj->new(%options);
$bool = $h->prepare($server);
undef = $h->finish($server, $clientSocket);
\%params = $h->uriParams($hreq,%opts);
\%params = $h->contentParams($hreq,%opts);
\%params = $h->params($hreq,%opts);
\%vars = $h->cgiParams($srv,$clientConn,$httpRequest, %opts);
\%vars = $h->decodeVars(\%vars,%opts);
\$string = $h->decodeString(\$string,%opts); ##-- decodes in-place;
\$string = $h->decodeStringRef(\$string,%opts); ##-- decodes in-place;
$enc = $h->messageEncoding($httpMessage,$defaultEncoding);
$enc = $h->requestEncoding($httpRequest,\%vars);
\%vars = $h->trimVars(\%vars,%opts);
\%vars = $h->addVars(\%vars,\%push,$mode='push');
$h = $class_or_obj->new(%options);
%option, %$h:
encoding => $defaultEncoding, ##-- default encoding (UTF-8)
allowGet => $bool, ##-- allow GET requests? (default=1)
allowPost => $bool, ##-- allow POST requests? (default=1)
pushMode => $mode, ##-- push mode for addVars (dfefault='push')
$bool = $h->prepare($server);
Just returns 1.
undef = $h->finish($server, $clientSocket);
Clean up handler state after run(). Override deletes @$h{qw(cgi vars cgisrc)}.
\%params = $h->uriParams($hreq,%opts)
Parses GET-style form parameters from $hreq->uri.
\%params = $h->contentParams($hreq,%opts);
Parses POST-style content parameters from $hreq. If $hreq content-type is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data', but content is present, returns $hreq content as the value of the pseudo-variable $opts{defaultName}. Known %opts:
defaultName => $name, ##-- default parameter name (default='POSTDATA')
defaultCharset => $charset, ##-- default charset
\%params = $h->params($hreq,%opts);
Wrapper for $h->pushVars($h->uriParams(),$h->contentParams()) %opts are passed to "uriParams"(), "contentParams"().
\%vars = $h->cgiParams($srv,$clientConn,$httpRequest, %opts);
parses cgi parameters from client request
only handles GET or POST requests
wrapper for $h->uriParams(), $h->contentParams()
%opts are passed to uriParams, contentParams
\%vars = $h->decodeVars(\%vars,%opts);
Decodes cgi-style variables using $h->decodeString($str,%opts). Known %opts:
vars => \@vars, ##-- list of vars to decode (default=keys(%vars))
someKey => $someVal, ##-- passed to $h-E<gt>decodeString()
\$string = $h->decodeString(\$string,%opts); ##-- decodes in-place;
$decoded = $h->decodeString( $string,%opts); ##-- decode by copy
Wrapper for "decodeStringRef"().
\$string = $h->decodeStringRef(\$string,%opts); ##-- decodes in-place;
Decodes string in-place as $h->{encoding}, optionally handling HTML-style escapes. Known %opts:
%opts: allowHtmlEscapes => $bool, ##-- whether to handle HTML escapes (default=false) encoding => $enc, ##-- source encoding (default=$h->{encoding}; see also $h->requestEncoding())
$enc = $h->messageEncoding($httpMessage,$defaultEncoding);
Atempts to guess messagencoding from (in order of descending priority):
HTTP::Message header Content-Type charset variable
HTTP::Message header Content-Encoding
$defaultEncoding (default=undef)
$enc = $h->requestEncoding($httpRequest,\%vars);
Attempts to guess request encoding from (in order of descending priority):
CGI param 'encoding', from $vars->{encoding}
HTTP::Message encoding via $h->messageEncoding($httpRequest)
$h->{encoding}
\%vars = $h->trimVars(\%vars,%opts);
Trims leading and trailing whitespace from selected values in \%vars. Known %opts:
vars => \@vars, ##-- list of vars to trim (default=keys(%vars))
\%vars = $h->addVars(\%vars,\%push,$mode='push');
CGI-like variable push; destructively adds \%push onto \%vars.
if $mode is 'push', dups are treated as array push
if $mode is 'clobber', dups in %push clobber values in %vars
if $mode is 'keep', dups in %push are ignored
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2010-2019 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.1 or, at your option, any later version of Perl 5 you may have available.
DTA::CAB::Server::HTTP::Handler(3pm), DTA::CAB::Server::HTTP(3pm), DTA::CAB(3pm), perl(1), ...