View on
MetaCPAN
search.cpan.org is shutting down
For details read Perl NOC. After June 25th this page will redirect to MetaCPAN.org
Chris Winters > OpenInteract-1.99_05 > OpenInteract2::Request::Standalone

Download:
OpenInteract-1.99_05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.13   Source   Latest Release: OpenInteract-1.99_06

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( ... ) },
   languages   => [ 'en-UK', 'en-US', 'de', 'fr' ],
 );
 
 # ...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' );
 $req->language_header( 'en, de;q=.96, fr;q=.92' );

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-2004 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>

syntax highlighting: