

The server will stay running until $server->stop METHODS Test::HTTP::LocalServer->spawn %ARGS my $server = Test::HTTP::LocalServer->spawn Use this web server if you write an HTTP client and want to exercise its behaviour in your test suite without talking to the outside world. It also takes care of cleaning %ENV from settings that influence the use of a local proxy etc. This module implements a tiny web server suitable for running "live" tests of HTTP clients against it. My $res = HTTP::Tiny->new->get( $server->url ) Request_pause => 1, # wait one second before accepting the next request My $server = Test::HTTP::LocalServer->spawn(

Test::HTTP::LocalServer - spawn a local HTTP server for testing SYNOPSIS use HTTP::Tiny Surprisingly large gzip encoded response $server->gzip.Surprisingly large bzip2 encoded response $server->bzip2.Error in response content $server->error_after_headers.Timeout+close $server->error_close($seconds).Timeout $server->error_timeout($seconds).404 error $server->error_notfound($target).401 basic authentication challenge $server->basic_auth($user, $pass).302 redirect $server->redirect($target).arbitrary content $server->content($html).
