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 $query  = CGI::PSGI->new( $env );
    my $header = CGI::Header::PSGI->new( query => $query );
      
    my $body = do {
        # run CGI.pm-based application
    };

    return [
        $header->status_code,
        $header->as_arrayref,
        [ $body ]
    ];
};

VERSION

This document refers to CGI::Header::PSGI 0.10.

DESCRIPTION

This module can be used to convert CGI.pm-compatible HTTP header properties into PSGI response header array reference.

This module requires 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.

METHODS

This class adds the following methods to CGI::Header:

$header->status_code

Returns HTTP status code.

$header->as_arrayref

Returns PSGI response header array reference.

SEE ALSO

CGI::Emulate::PSGI

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.