Konstrukt::Response - Class for everything related to the generated response
#set/get status code $Konstrukt::Response->status('200'); my $s = $Konstrukt::Request->status(); #set/get header $Konstrukt::Response->header('Content-Type' => 'text/html'); my $c = $Konstrukt::Response->header('Content-Type'); #all heades as hash ref my $h = $Konstrukt::Response->headers();
This object will provide access to some response-related information for the response, which is currently generated.
Usually you will only set data for the respons, but you may also read it.
To get the request data you should use Konstrukt::Request.
It's similar to HTTP::Response but without some methods, that are not needed here.
Parameters:
To initialize the response object you can specify these optional keys:
my $r = Konstrukt::Response->new( status => '200', headers => { 'Content-Type' => 'text/html' } );
Returns the current status code. If the status parameter is defined, the current status code will be overwritten.
$status - Optional: When defined, this status code will replace the current status code
Returns the value of the requested header field or undef, if no such header field exists. If the value parameter is defined, the current value for the specified header field will be overwritten.
$field - The header field
$value - Optional: When defined, this value will replace the current value for the specified header field
Returns a hash reference containing all set header fields and the appropriate values.
Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.
Konstrukt::Request, Konstrukt::Handler
To install Konstrukt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Konstrukt
CPAN shell
perl -MCPAN -e shell install Konstrukt
For more information on module installation, please visit the detailed CPAN module installation guide.