ASP4::Mock::RequestRec - Mimic an Apache2::RequestRec object
When an ASP4 request is executed outside of a mod_perl2 environment, it uses an instance of ASP4::Mock::RequestRec in place of the Apache2::RequestRec it would otherwise have.
ASP4::Mock::RequestRec
Sets or gets the value of a named "pnote" for the duration of the request.
Example:
$r->pnotes( foo => "foovalue" ); my $val = $r->pnotes( 'foo' );
Sets or gets the querystring for the request.
my $str = $r->args(); $r->args( 'foo=bar&baz=bux' );
Sets or gets the URI for the current request:
my $uri = $r->uri; $r->uri( '/path/to/page.asp' );
Gets the document root for the server. This is the same as $config->web->www_root.
my $root = $r->document_root; # /var/www/mysite.com/htdocs
Gets the request method for the current request. Eg: GET or POST.
GET
POST
if( $r->method eq 'GET' ) { # It's a "GET" request: } elsif( $r->method eq 'POST' ) { # It's a "POST" request: }
Returns the current ASP4::Mock::Pool object.
my $pool = $r->pool;
Returns the current ASP4::Mock::Connection object.
my $connection = $r->connection;
Returns a hashref representing the outgoing headers.
Sets or gets the status code for the response. 200 for "OK", 301 for "Moved" - 404 for "not found" etc.
Sets or gets the mime-header for the outgoing response. Default is text/plain.
text/plain
Adds $str to the outgoing response buffer.
$str
Does nothing.
It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=ASP4 to submit bug reports.
Please visit the ASP4 homepage at http://0x31337.org/code/ to see examples of ASP4 in action.
To install ASP4, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ASP4
CPAN shell
perl -MCPAN -e shell install ASP4
For more information on module installation, please visit the detailed CPAN module installation guide.