HTTP-Response-CGI
view release on metacpan or search on metacpan
t/parse-regular-http.t view on Meta::CPAN
use Test::More tests => 3;
# Parse normal HTTP output
# (to ensure that we're not breaking the parent HTTP::Response functionality)
use HTTP::Response::CGI;
# Example test values.
my $status = 'HTTP/1.1 200 OK';
my @headers = (
'Content-type: text/html',
'X-Forwarded-For: 127.0.0.1',
);
my $body = 'This is the body.';
my $output;
my $response;
$output = $status . "\n" . join( "\n", @headers ) . "\n\n" . $body;
$response = HTTP::Response::CGI->parse($output);
is( $response->protocol, 'HTTP/1.1' );
is( $response->code, '200' );
is( $response->message, 'OK' );
( run in 0.644 second using v1.01-cache-2.11-cpan-39bf76dae61 )