-
-
07 Mar 2016 22:31:57 UTC
- Distribution: Test-HTTP-Server
- Module version: 0.04
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (3)
- Testers (2364 / 2 / 0)
- Kwalitee
Bus factor: 1- 79.43% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (12.58KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
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.
Module Install Instructions
To install Test::HTTP::Server, copy and paste the appropriate command in to your terminal.
cpanm Test::HTTP::Server
perl -MCPAN -e shell install Test::HTTP::Server
For more information on module installation, please visit the detailed CPAN module installation guide.