
Apache2::ASP::Test::UserAgent - Execute ASP scripts without a webserver.

Generally you will be accessing this class from wither Apache2::ASP::Test::Base or Apache2::ASP::API.
my $asp = Apache2::ASP::API->new()
-- or --
my $asp = Apache2::ASP::Test::Base->new();
# Get:
my $res = $asp->ua->get("/index.asp");
if( $res->is_succes ) {
...
}
# Post:
my $res = $asp->ua->post("/handlers/contact.form", [
name => "Fred",
email => 'fred@flintstone.org',
message => 'This is a test email message.'
]);
# Do the same thing, but with HTML::Form:
use HTML::Form;
my $form = HTML::Form->parse( $asp->ua->get("/contact.asp")->content, '/' );
$form->find_input('name')->value('Fred');
$form->find_input('email')->value('fred@flintstone.org');
$form->find_input('message')->value('This is a test email message');
my $res = $asp->ua->submit_form( $form );
# Upload:
my $res = $asp->ua->upload("/handlers/MM?mode=create&uploadID=12334534", [
filename => ['/path/to/file.txt'],
]);

Returns the current Apache2::ASP::HTTPContext object.

Makes a "GET" request to $url
Makes a "POST" reqest to $url, using @args as the body.
Makes a "POST" request with a multipart/form-data type, using @args as the body.
Submits the form.
NOTE: - this will not work for "upload" forms (yet).

It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

John Drago mailto:jdrago_999@yahoo.com

Copyright 2007 John Drago, All rights reserved.
This software is free software. It may be used and distributed under the same terms as Perl itself.