HTTP::Response::CGI - HTTP style response message, from CGI output
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"; }
The HTTP::Response::CGI class sub-classes HTTP::Response from libwwwperl.
HTTP::Response::CGI
HTTP::Response
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.
RFC 3875(http://www.ietf.org/rfc/rfc3875.txt)
RFC 3875
Ken Dreyer, <ktdreyer[at]ktdreyer.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTTP::Response::CGI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Response::CGI
CPAN shell
perl -MCPAN -e shell install HTTP::Response::CGI
For more information on module installation, please visit the detailed CPAN module installation guide.