Neil Bowers > Test-HTTP-Server-0.04 > Test::HTTP::Server

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

Dependencies

Annotate this POD

Website

CPAN RT

New  3
Open  0
View/Report Bugs
Module Version: 0.04   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";

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.

syntax highlighting: