in reply to Checking that a page gets served via HTTPS
I'm a fan of WWW::Mechanize. Below is an example. the cookie jar is not always needed of course.
use strict;
use WWW::Mechanize;
use Data::Dumper;
use HTTP::Cookies;
my $server_name = "https://flutest.lanl.gov";
my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new);
warn "testing on $server_name";
my $results = $mech->get($server_name);
#warn Dumper $results;
if($results->content =~ /please enter your login and password to authenticate/)
{
print "site is up";
}
else
{
warn Dumper $results;
die "site is down!!!";
}
|
|---|