NAME

RayApp::Request - common object for both mod_perl and CGI requests

SYNOPSIS

my $q = new RayApp::Request($r);
print $q->param('name');

DESCRIPTION

The RayApp module can operate both as a mod_perl handler and as a CGI application. You can switch from one mode to another by simply changing the Apache configuration, without any change in your .pl or .mpl code. In fact, you can have both mod_perl and CGI handling specified for the same directory -- the first is nice for production speed, the second makes sure that all your module changes are reloaded properly for each request, should you be doing some development changes.

The RayApp::Request module provides unified interface to CGI.pm and Apache2::Request objects. The following method are available:

new

The constructor. If you pass in an argument, it is considered to be a Apache2::RequestRec object, and the APR routines will be used. Otherwith CGI.pm is used.

param

A method for fetching or setting the value of parameters. For GET, it always deals with the values from the query string, for POST it handles only the values from the body of the HTTP request.

If run without any argument, it returns the list of parameters.

If run with one argument, it returns one (in scalar context) or all values for the given parameter name.

If run with multiple parameters, the second to the last are set as the new value of the parameter, whose name is the first argument.

delete

Deletes the value (or values) from the parameter whose name is the first argument.

user, remote_user

Returns the login used for the HTTP Basic authentication, if it is an authenticated request.

request_method

Returns the request method.

referer

The URL of the referer, provided the client sends the appropriate HTTP header.

url

Returns the self url of the request. Can take arguments

base

Only the base is returned.

absolute, relative, full

Absolute, relative and full URL of the request (the default is relative).

path_info

The path info will be appended.

query

The query string will be returned.

remote_addr

The IP address of the remote host (the client).

remote_host

The name of the remote host, provided the httpd server is set to do the DNS lookups.

body

The raw body of the request. Usefull for fetching XML documents or other inputs that are not CGI parameter values.

upload

Returns one or multiple RayApp::Request::Upload objects that provide access to uploaded files. The object has the following methods: filename, size, content_type, and content.

Returns on or multiple values of a HTTP cookie, submitted by the client.

SEE ALSO

RayApp(3)

AUTHOR

Copyright (c) Jan Pazdziora 2001--2006

VERSION

This documentation is believed to describe accurately RayApp version 2.004.