Subject: | get_ok fails to get, where LWP::UserAgent succeeds |
Perhaps I am doing something very silly here, in which case please
accept my advance apologies:
use strict;
use warnings;
use Test::More tests => 3;
use Test::WWW::Mechanize;
use LWP::UserAgent;
my $API_ROOT = 'http://PC-L438542.national.core.bbc.co.uk/';
my $mech = Test::WWW::Mechanize->new;
isa_ok( $mech, 'Test::WWW::Mechanize', 'HTTP Test Object');
$mech->timeout(10);
$mech->get_ok( $API_ROOT, 'Root' );
my $ua = LWP::UserAgent->new;
$ua->timeout(2);
my $response = $ua->get($API_ROOT);
ok($response->is_success, 'Root');
__END__
OUTPUT:
1..3
ok 1 - HTTP Test Object isa Test::WWW::Mechanize
not ok 2 - Root
# Failed test 'Root'
# in C:\temp.pl at line 12.
# 500
# read timeout
ok 3 - Root
# Looks like you failed 1 test of 3.
Tool completed with exit code 1