Test::HTTP::Server - simple forking http server
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" }
This package provices a simple forking http server which can be used for testing http clients.
Lists user methods.
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";
Sends a pattern.
system "wget", $server->uri . "repeat/2/foobar";
To install Test::HTTP::Server, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::HTTP::Server
CPAN shell
perl -MCPAN -e shell install Test::HTTP::Server
For more information on module installation, please visit the detailed CPAN module installation guide.