NAME
OpenFrame::AbstractRequest - An abstract request class
SYNOPSIS
use OpenFrame::AbstractRequest;
use OpenFrame::AbstractCookie;
my $uri = URI->new("http://localhost/");
my $r = OpenFrame::AbstractRequest->new(uri => $uri,
originator => 'http://www.example.com/',
descriptive => 'web',
argumentss => { colour => 'red' },
cookies => OpenFrame::AbstractCookie->new());
print "URI: " . $r->uri();
print "Originator: " . $r->originator();
print "Descriptive: " . $r->descriptive();
my $args = $r->arguments();
my $cookies = $r->cookies();
DESCRIPTION
OpenFrame::AbstractRequest
represents requests inside OpenFrame. Requests represent some kind of request for information given a URI.
This module abstracts the way clients can request data from OpenFrame. For example OpenFrame::Server::Apache
converts Apache::Request GET and POST requests into an OpenFrame::AbstractRequest
, which is then used through OpenFrame.
METHODS
new()
The new() method creates a new OpenFrame::AbstractRequest
object. It takes a variety of parameters, of which only the "uri" parameter is mandatory.
The parameters are:
- uri
-
The location this request is for. This must be a URI object.
- originator
-
A string describing the originator of the request. Defaults to "GenericServer".
- descriptive
-
A string describing the type of the request. Defaults to "web".
- arguments
-
A hash reference which are the arguments passed along with the request.
-
An
OpenFrame::AbstractCookie
object which contains any cookies passed with the request.
my $uri = URI->new("http://localhost/");
my $r = OpenFrame::AbstractRequest->new(uri => $uri,
originator => 'secret agent',
descriptive => 'web',
arguments => { colour => 'red' },
cookies => OpenFrame::AbstractCookie->new());
uri()
This method gets and sets the URI.
print "URI: " . $r->uri();
$r->uri(URI->new("http://foo.com/"));
originator()
This method gets and sets the originator string.
print "Originator: " . $r->originator();
$r->setOriginator("me");
descriptive()
This method gets and sets the descriptive string.
print "Descriptive: " . $r->descriptive();
$r->descriptive("smtp");
cookies()
This method gets and sets the OpenFrame::AbstractCookie
object associated with this request.
my $cookietin = $r->cookies();
$r->cookies($cookietin);
arguments()
This method gets and sets the argument hash reference associated with this request.
my $args = $r->arguments();
$r->arguments({colour => "blue"});
AUTHOR
James Duncan <jduncan@fotango.com>