The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::HTTP::Server - simple forking http server

SYNOPSIS

 my $server = Test::HTTP::Server->new();

 client_get( $server->uri . "my_request" );

 sub Test::HTTP::Server::Request::my_request
 {
     my $self = shift;
     return "foobar!\n"
 }

DESCRIPTION

This package provices a simple forking http server which can be used for testing http clients.

DEFAULT METHODS

index

Lists user methods.

echo / TYPE

Returns whole request in the body. If TYPE is "head", only request head will be echoed, if TYPE is "body" (i.g. post requests) only body will be sent.

 system "wget", $server->uri . "echo/head";

Sets a cookie. REPEAT is the number of cookies to be sent. PATTERN is the cookie pattern.

 system "wget", $server->uri . "cookie/3";
repeat / REPEAT / PATTERN

Sends a pattern.

 system "wget", $server->uri . "repeat/2/foobar";

AUTHOR

Przemysław Iskra <sparky@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Przemysław Iskra.

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