9 use HTTP::Request::AsCGI;
12 unless ( $Config{d_fork} ) {
13 plan skip_all => 'This test requires a platform that supports fork()';
21 my $r = HTTP::Request->new( GET => 'http://www.host.com/' );
22 my $c = HTTP::Request::AsCGI->new($r);
26 unless ( defined $kid ) {
27 die("Can't fork() kid: $!");
34 print "HTTP/1.0 200 OK\n";
35 print "Content-Type: text/plain\n";
36 print "Status: 200\n";
49 $response = $c->response;
52 isa_ok( $response, 'HTTP::Response' );
53 is( $response->code, 200, 'Response Code' );
54 is( $response->message, 'OK', 'Response Message' );
55 is( $response->protocol, 'HTTP/1.0', 'Response Protocol' );
56 is( $response->content, 'Hello!', 'Response Content' );
57 is( $response->content_length, 6, 'Response Content-Length' );
58 is( $response->content_type, 'text/plain', 'Response Content-Type' );
59 is_deeply( [ $response->header('X-Field') ], [ 1, 2 ], 'Response Header X-Field' );