Ken Dreyer > HTTP-Response-CGI-1.0 > HTTP::Response::CGI

Download:
HTTP-Response-CGI-1.0.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.0   Source  

NAME ^

HTTP::Response::CGI - HTTP style response message, from CGI output

SYNOPSIS ^

Use this sub-class of HTTP::Response to parse CGI output.

        # ...
        my $output = $cgiapp->run();
        $response = HTTP::Response::CGI->parse($output)
        # Use $response as a normal HTTP::Response object.
        # ...
        if ($response->is_success) {
                print $response->decoded_content;
        } else {
                print STDERR $response->status_line, "\n";
        }

DESCRIPTION ^

The HTTP::Response::CGI class sub-classes HTTP::Response from libwwwperl.

The main distinction is that this module's parse() accepts CGI output. CGI programs do not print the first line ("status line") of the HTTP protocol (eg. "HTTP/1.1 200 OK"). Instead, they communicate a special "Status:" header to the web server, and the web server translates this into the HTTP status line.

This module's parse() function provides that translation.

SEE ALSO ^

HTTP::Response

RFC 3875(http://www.ietf.org/rfc/rfc3875.txt)

AUTHOR ^

Ken Dreyer, <ktdreyer[at]ktdreyer.com>

COPYRIGHT ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: