CGI-Lite-Request
view release on metacpan or search on metacpan
lib/CGI/Lite/Request.pm view on Meta::CPAN
Constructor
=item parse
This method must be called explicitly to fetch the incoming request before
=item headers
accessor to an internally kept L<HTTP::Headers> object.
=item parse
parses the incoming request - this is called automatically from the
constructor, so you shouldn't need to call this expicitly.
=cut
=item args
return the request parameters as a hash or hash reference depending on
the context. All form data, query string and cookie parameters are available
in the returned hash(ref)
=item param( $key )
get a named parameter. If called in a scalar context, and if more than one
value exists for a field name in the incoming form data, then an array reference
is returned, otherwise for multiple values, if called in a list context, then
an array is returned. If the value is a simple scalar, then in a scalar context
just that value is returned.
=item params
returns all the parameters in the order in which they were parsed. Also includes
cookies and query string parameters.
=item uri
returns the url minus the query string
=item secure
returns true if the request came over https
=item path_info
accessor to the part of the url after the script name
=item print
print to respond to the request. This is normally done after
C<send_http_header> to print the body of data which should be
sent back the the user agent
=item send_http_header
combines the response headers and sends these to the user agent
=item cookie
returnes a named L<CGI::Lite::Cookie> object. If one doesn't
exist by the passed name, then creates a new one and returns
it. Typical semantics would be:
$sessid = $req->cookie('SID')->value;
$req->cookie('SID')->value($sessid);
both of these methods will create a new L<CGI::Lite::Request::Cookie>
object if one named 'SID' doesn't already exist. If you don't
want this behaviour, see C<cookies> method
=item cookies
returns a hash reference of L<CGI::Lite::Request::Cookie> objects keyed on their names.
This can be used for accessing cookies where you don't want them
to be created automatically if they don't exists, or for simply
checking for their existence:
if (exists $req->cookies->{'SID'}) {
$sessid = $req->cookies->{'SID'}->value;
}
see L<CGI::Lite::Request::Cookie> for more details
=item upload
returns a named L<CGI::Lite::Upload> object keyed on the field name
with which it was associated when uploaded.
=item uploads
returns a hash reference of all the L<CGI::Lite::Request::Upload> objects
keyed on their names.
see L<CGI::Lite::Request::Upload> for details
=head1 AUTHOR
Richard Hundt <richard NO SPAM AT protea-systems.com>
=head1 ACKNOWLEDGEMENTS
Thanks to Sebastian Riedel for the code shamelessly stolen
from L<Catalyst::Request> and L<Catalyst::Request::Upload>
=head1 SEE ALSO
L<CGI::Lite>, L<CGI::Lite::Cookie>, L<CGI::Lite::Upload>
=head1 LICENCE
This library is free software and may be used under the same terms as Perl itself
=cut
( run in 0.790 second using v1.01-cache-2.11-cpan-9581c071862 )