HTTP-Response-Parser
view release on metacpan or search on metacpan
t/01_basic.t view on Meta::CPAN
}
----------
HTTP/1.0 200 OK
Content-Type: text/html
hogehoge
----------
{
'_content' => "hogehoge\n",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.0 200 OK
Content-Type: text/html
X-Test: 1
X-Test: 2
hogehoge
----------
{
'_content' => "hogehoge\n",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html", "x-test" => [1,2]},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.0 200 OK
Content-Type: text/html
X-Test: 1
X-Test: 2
hogehoge
----------
{
'_content' => "hogehoge\n",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html", "x-test" => "1\n X-Test: 2"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.0 200 OK
Content-Type: text/html
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.0',
'_headers' => { "content-type" => "text/html"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.1 200 OK
Content-Type: text/html
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.1',
'_headers' => { "content-type" => "text/html"},
'_rc' => 200,
'_msg' => 'OK'
}
----------
HTTP/1.1 404 Not Found
Content-Type: text/html
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.1',
'_headers' => { "content-type" => "text/html"},
'_rc' => 404,
'_msg' => 'Not Found'
}
----------
HTTP/1.1 200 OK
Content-Type: text/html
FOO_BAR: 42
----------
{
'_content' => "",
'_protocol' => 'HTTP/1.1',
'_headers' => { "content-type" => "text/html", "foo-bar" => 42},
'_rc' => 200,
'_msg' => 'OK'
}
__HEADERS
my $backend;
sub do_test {
note $backend;
my @tests = split '-'x10, $tests;
( run in 1.765 second using v1.01-cache-2.11-cpan-524268b4103 )