Przemysław Iskra > Test-HTTP-Server-0.03 > Test::HTTP::Server

Download:
Test-HTTP-Server-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Module Version: 0.03   Source  

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";
cookie / REPEAT / PATTERN

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";
syntax highlighting: