NAME
CGI::Header::PSGI - Generate PSGI-compatible response header arrayref
SYNOPSIS
use CGI::PSGI;
use CGI::Header::PSGI;
my $app = sub {
my $env = shift;
my $header = CGI::Header::PSGI->new( query => CGI::PSGI->new($env) );
...
return [
$header->status_code,
$header->as_arrayref,
[ "Hello, World" ]
];
};
VERSION
This document refers to CGI::Header::PSGI 0.06.
DESCRIPTION
This class inherits from CGI::Header, and also overrides some methods to adapt your CGI.pm-based application for PSGI-specification.
This module doesn't care if your query class is orthogonal to a global variable %ENV
. For example, CGI::PSGI
adds the env
attribute to CGI.pm, and also overrides some methods which refer to %ENV
directly. This module doesn't solve those problems at all. In other words, this module requires your query class is orthogonal to %ENV
.
METHODS
This class adds the following methods to CGI::Header
.
- $header->status_code
-
Returns HTTP status code.
- $header->as_arrayref
-
Returns PSGI header array reference.
SEE ALSO
AUTHOR
Ryo Anazawa (anazawa@cpan.org)
LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.