2 HTTP::Body - HTTP Body Parser
8 my ( $class, $r ) = @_;
10 my $content_type = $r->headers_in->get('Content-Type');
11 my $content_length = $r->headers_in->get('Content-Length');
13 my $body = HTTP::Body->new( $content_type, $content_length );
14 my $length = $content_length;
18 $r->read( my $buffer, ( $length < 8192 ) ? $length : 8192 );
20 $length -= length($buffer);
25 my $uploads = $body->upload; # hashref
26 my $params = $body->param; # hashref
27 my $body = $body->body; # IO::Handle
34 new Constructor. Takes content type and content length as parameters,
35 returns a HTTP::Body object.
37 add Add string to itnernal buffer. Will call spin unless done. returns
38 length before adding self.
41 accessor for the body.
44 read only accessor for the buffer.
47 read only accessor for content length
50 ready only accessor for the content type
56 read only accessor for body length.
59 Abstract method to spin the io handle.
62 accessor for body state.
65 accesor for http parameters.
70 Christian Hansen, "ch@ngmedia.com"
72 Sebastian Riedel, "sri@cpan.org"
75 This library is free software. You can redistribute it and/or modify it
76 under the same terms as perl itself.