Apache::RequestIO - Perl API for Apache request record IO
use Apache::RequestIO ();
META: to be completed
Apache::RequestIO provides the API to perform IO on the Apache request object.
Apache::RequestIO
Apache::RequestIO provides the following functions and/or methods:
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();
$r
Apache::RequestRec
The current request
$ret
error status if request is malformed, Apache::OK otherwise
setup_client_block
META: I think this method is deprecated along with other client_block methods, use plain $r-<read() instead.
Setup the client to allow Apache to read the request body.
$ret = $r->setup_client_block($read_policy);
$read_policy
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.
either OK or an error code
should_client_block
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();
0 if there is no message to read, 1 otherwise
print
Send data to the client.
$ret = $r->print(@msg);
@msg
read
Read data from the client.
$read_count = $r->read($buffer, $len, $offset);
META: same as CORE::read, minus the filehandle argument
$buffer
$len
$offset
$read_count
How many characters were actually read
rflush
Flush any buffered data to the client.
$ret = $r->rflush();
Unless $| > 0, data sent via $r->print() is buffered. This method flushes that data to the client.
$|
$r->print()
sendfile
$ret = $r->sendfile($filename, $offset, $len);
$filename
write
Write data to the client
$ret = $r->write($buffer, $bufsiz, $offset);
$bufsiz
OPEN
$ret = OPEN($self, $arg1, $arg2);
$self
$arg1
$arg2
UNTIE
$ret = $r->UNTIE($refcnt);
$refcnt
PRINTF
$ret = PRINTF(...);
...
CLOSE
$ret = $r->CLOSE();
PRINT
$ret = PRINT(...);
BINMODE
$ret = $r->BINMODE();
WRITE
$ret = $r->WRITE($buffer, $bufsiz, $offset);
TIEHANDLE
$ret = TIEHANDLE($stashsv, $sv);
$stashsv
$sv
READ
$ret = $r->READ($buffer, $len, $offset);
mod_perl 2.0 documentation.
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 1.1.
The mod_perl development team and numerous contributors.
To install mod_perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm mod_perl
CPAN shell
perl -MCPAN -e shell install mod_perl
For more information on module installation, please visit the detailed CPAN module installation guide.