
ASP4::UserAgent - Execute ASP4 requests without a web server.

NOTE: 99.99% of the time you will access this via ASP4::API.
my HTTP::Response $res = $api->ua->get('/index.asp?foo=bar');
my $res = $api->ua->post('/handlers/user.login', [
username => 'willy',
password => 'wonka',
]);
my $res = $api->ua->upload('/handlers/file.upload', [
foo => 'bar',
baz => 'bux',
file => ['/home/john/avatar.jpg']
]);
# Some form testing:
my ($form) = HTML::Form->parse( $res->content, '/' );
$form->find_input('username')->value('bob');
my $res = $api->ua->submit_form( $form );
# Add/remove a cookie:
$api->ua->add_cookie( "the-boss" => "me" );
$api->remove_cookie( "the-boss" );

Enables unit-testing ASP4 applications by providing the ability to execuite web pages from your code, without a webserver.

Calls $url and returns the HTTP::Response result.
Calls $url with $args and returns the HTTP::Response result.
Calls $url with $args and returns the HTTP::Response result.
Submits the $form and returns the HTTP::Response result.
Adds the cookie to all subsequent requests.
Removes the cookie (if it exists).


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

Please visit the ASP4 homepage at http://0x31337.org/code/ to see examples of ASP4 in action.