HTTP-Server-Encrypt
view release on metacpan or search on metacpan
my $ua = LWP::UserAgent->new;
$ua->timeout(9);
my $url;
my $response;
$url = "http://127.0.0.1:1024/index.html";
$response = $ua->get($url);
is($response->code, 401, "Response has HTTP Base Authorization (401) status");
$ua->credentials( "127.0.0.1:1024", "Colonel Authentication System", "username", "passwd" );
$response = $ua->get($url);
is($response->code, 200, "Response has HTTP OK (2xx) status");
$url = "http://127.0.0.1:1024/page_no_found";
$response = $ua->get($url);
is($response->code, 404, "Response has HTTP Not Found (404) status");
kill TERM => $pid;
1;
( run in 0.759 second using v1.01-cache-2.11-cpan-4d50c553e7e )