10 use YAML qw[LoadFile];
12 my $number = $ARGV[0] || 1;
13 my $what = $ARGV[1] || 'multipart';
16 my $headers = LoadFile( sprintf( "t/data/%s/%.3d-headers.yml", $what, $number ) );
17 my $content = IO::File->new( sprintf( "t/data/%s/%.3d-content.dat", $what, $number ), O_RDONLY );
18 my $body = HTTP::Body->new( $headers->{'Content-Type'}, $headers->{'Content-Length'} );
22 while ( $content->read( my $buffer, 1024 ) ) {
26 warn Dumper( $body->param );
27 warn Dumper( $body->upload );
28 warn Dumper( $body->body );
30 warn "state : " . $body->state;
31 warn "length : " . $body->length;
32 warn "content length : " . $body->content_length;
33 warn "body length : " . ( $body->body->stat )[7] if $body->body;
34 warn "buffer : " . $body->buffer if $body->buffer;