=head1 NAME

Apache::RequestIO - Perl API for Apache request record IO




=head1 Synopsis

  use Apache::RequestIO ();

META: to be completed




=head1 Description

C<Apache::RequestIO> provides the API to perform IO on the L<Apache
request object|docs::2.0::api::Apache::RequestRec>.




=head1 API

C<Apache::RequestIO> provides the following functions and/or methods:




=head2 C<discard_request_body>

META: Autogenerated - needs to be reviewed/completed

In HTTP/1.1, any method can have a body.  However, most GET handlers
wouldn't know what to do with a request body if they received one.
This helper routine tests for and reads any message body in the request,
simply discarding whatever it receives.  We need to do this because
failing to read the request body would cause it to be interpreted
as the next request on a persistent connection.

  $ret = $r->discard_request_body();

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

The current request

=item ret: C<$ret> (integer)

error status if request is malformed, Apache::OK otherwise

=back





=head2 C<setup_client_block>

META: Autogenerated - needs to be reviewed/completed

META: I think this method is deprecated along with other client_block
methods, use plain $r-E<lt>read() instead.

Setup the client to allow Apache to read the request body.

  $ret = $r->setup_client_block($read_policy);

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

The current request

=item arg2: C<$read_policy> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

How the server should interpret a chunked transfer-encoding. One of:

    REQUEST_NO_BODY          Send 413 error if message has any body
    REQUEST_CHUNKED_ERROR    Send 411 error if body without Content-Length
    REQUEST_CHUNKED_DECHUNK  If chunked, remove the chunks for me.

=item ret: C<$ret> (integer)

either OK or an error code

=back





=head2 C<should_client_block>

META: Autogenerated - needs to be reviewed/completed

META: I think this method is deprecated along with other client_block
methods, use plain $r-E<lt>read() instead.

Determine if the client has sent any data.  This also sends a
100 Continue response to HTTP/1.1 clients, so modules should not be called
until the module is ready to read content.

  $ret = $r->should_client_block();

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

The current request

=item ret: C<$ret> (integer)

0 if there is no message to read, 1 otherwise

=back




=head2 C<print>

Send data to the client.

  $ret = $r->print(@msg);

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg2: C<@msg> (ARRAY)

=item ret: C<$ret> (number)

=back




=head2 C<read>

Read data from the client.

  $read_count = $r->read($buffer, $len, $offset);

META: same as CORE::read, minus the filehandle argument

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg2: C<$buffer> (scalar)

=item arg3: C<$len> (scalar)

=item arg4: C<$offset> (number)

=item ret: C<$read_count> (number)

How many characters were actually read

=back




=head2 C<rflush>

Flush any buffered data to the client.

  $ret = $r->rflush();

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item ret: C<$ret> (integer)

=back

Unless C<$|> E<gt> 0, data sent via C<L<$r-E<gt>print()|/C_print_>> is
buffered. This method flushes that data to the client.




=head2 C<sendfile>

META: Autogenerated - needs to be reviewed/completed

  $ret = $r->sendfile($filename, $offset, $len);

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg2: C<$filename> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg3: C<$offset> (integer)

=item arg4: C<$len> (integer)

=item ret: C<$ret> (integer)

=back





=head2 C<write>

META: Autogenerated - needs to be reviewed/completed

Write data to the client

  $ret = $r->write($buffer, $bufsiz, $offset);

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg2: C<$buffer> (scalar)

=item arg3: C<$bufsiz> (scalar)

=item arg4: C<$offset> (number)

=item ret: C<$ret> (number)

=back




=head1 TIE Interface

=head2 C<OPEN>

META: Autogenerated - needs to be reviewed/completed

  $ret = OPEN($self, $arg1, $arg2);

=over 4

=item arg1: C<$self> (scalar)

=item arg2: C<$arg1> (scalar)

=item arg3: C<$arg2> (scalar)

=item ret: C<$ret> (integer)

=back


=head2 C<UNTIE>

META: Autogenerated - needs to be reviewed/completed



  $ret = $r->UNTIE($refcnt);

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg2: C<$refcnt> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item ret: C<$ret> (scalar)

=back





=head2 C<PRINTF>

META: Autogenerated - needs to be reviewed/completed



  $ret = PRINTF(...);

=over 4

=item arg1: C<...> (scalar)

=item ret: C<$ret> (number)

=back





=head2 C<CLOSE>

META: Autogenerated - needs to be reviewed/completed

  $ret = $r->CLOSE();

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item ret: C<$ret> (scalar)

=back





=head2 C<PRINT>

META: Autogenerated - needs to be reviewed/completed



  $ret = PRINT(...);

=over 4

=item arg1: C<...> (scalar)

=item ret: C<$ret> (number)

=back





=head2 C<BINMODE>

META: Autogenerated - needs to be reviewed/completed



  $ret = $r->BINMODE();

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item ret: C<$ret> (scalar)

=back





=head2 C<WRITE>

META: Autogenerated - needs to be reviewed/completed


  $ret = $r->WRITE($buffer, $bufsiz, $offset);

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg2: C<$buffer> (scalar)

=item arg3: C<$bufsiz> (scalar)

=item arg4: C<$offset> (integer)

=item ret: C<$ret> (integer)

=back





=head2 C<TIEHANDLE>

META: Autogenerated - needs to be reviewed/completed



  $ret = TIEHANDLE($stashsv, $sv);

=over 4

=item arg1: C<$stashsv> (scalar)

=item arg2: C<$sv> (scalar)

=item ret: C<$ret> (scalar)

=back





=head2 C<READ>

META: Autogenerated - needs to be reviewed/completed



  $ret = $r->READ($buffer, $len, $offset);

=over 4

=item arg1: C<$r> (C<L<Apache::RequestRec|docs::2.0::api::Apache::RequestRec>>)

=item arg2: C<$buffer> (scalar)

=item arg3: C<$len> (scalar)

=item arg4: C<$offset> (integer)

=item ret: C<$ret> (scalar)

=back




=head1 See Also

L<mod_perl 2.0 documentation|docs::2.0::index>.




=head1 Copyright

mod_perl 2.0 and its core modules are copyrighted under
The Apache Software License, Version 1.1.




=head1 Authors

L<The mod_perl development team and numerous
contributors|about::contributors::people>.

=cut

