Home | Wiki | OI 1.x Docs | OI 2.x Docs OI logo

NAME

OpenInteract2::Request::Standalone - Manually create a request object

SYNOPSIS

 # Set the request implementation to use
 
 OpenInteract2::Request->set_implementation_type( 'standalone' );
 
 # Create all the request infomration offline...
 
 my %req_params = (
   url         => '/path/to/my/doc.html',
   referer     => 'http://www.foo.bar/path/to/my/index.html',
   user_agent  => 'OI2 Standalone Requester',
   server_name => 'www.foo.bar',
   remote_host => '192.168.1.1',
   param       => { eyes => 'two',
                    soda => [ 'rc', 'mr. pibb' ] },
   cookie      => [ 'lastSeen=1051797475;firstLogin=1051797075',
                    OpenInteract2::Cookie->new( ... ), ],
   upload      => { sendfile   => OpenInteract2::Upload->new( ... ),
                    screenshot => OpenInteract2::Upload->new( ... ) },
 );
 
 # ...and create a new object with it
 
 my $req = OpenInteract2::Request->new( \%req_params );
 
 # ...or just create an empty object with the bare minimum of
 # infomration and set properties as needed
 
 my $req = OpenInteract2::Request->new( { url => '/path/to/my/doc.html' } );
 $req->referer( 'http://www.foo.bar/path/to/my/index.html' );
 $req->param( eyes => 'two' );
 $req->param( soda => [ 'rc', 'mr. pibb' ] );
 $req->cookie( lastSeen => '1051797475' );

DESCRIPTION

This object is mainly used for testing, but you can also use it as glue to some other operating environment. The only thing this module does is take the properties passed into the new() call (and passed by OpenInteract2::Request via init()) and set them into the object.

METHODS

init( \%properties )

Set all the properties from \%properties in the object. Since almost all the properties are simple key/value pairs this is straightforward. There are a few more complicated ones:

The simple request properties set are:

BUGS

None known.

TO DO

Add settable auth_* properties

Add settable theme_* properties?

SEE ALSO

OpenInteract2::Response::Standalone

COPYRIGHT

Copyright (c) 2001-2003 Chris Winters. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Chris Winters <chris@cwinters.com>

Generated from the OpenInteract 1.99_03 source.


Home | Wiki | OI 1.x Docs | OI 2.x Docs
SourceForge Logo