in reply to Problem with HEAD.. but I think can be related with DNS
Works for me. Note you are not doing a HEAD request, but a GET. I changed your sub a little (moved the use statements to the top of the script).
sub simple_get { my $url = shift; my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new(GET => $url); my $response = $ua->request($request); warn "ERROR!" unless $response->is_success; print $response->as_string; }
And this is the output–
200 OK Server: Welcome to UniProt FTP service. Content-Length: 151 Content-Type: text/plain Last-Modified: Wed, 19 Mar 2014 14:00:00 GMT Client-Date: Thu, 20 Mar 2014 17:25:38 GMT Client-Request-Num: 1 UniProt Knowledgebase Release 2014_03 consists of: UniProtKB/Swiss-Prot Release 2014_03 of 19-Mar-2014 UniProtKB/TrEMBL Release 2014_03 of 19-Mar-2014
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with HEAD.. but I think can be related with DNS
by angeloulivieri (Novice) on Mar 20, 2014 at 17:31 UTC | |
by Anonymous Monk on Mar 21, 2014 at 09:22 UTC | |
by angeloulivieri (Novice) on Mar 21, 2014 at 09:35 UTC | |
by Corion (Patriarch) on Mar 21, 2014 at 09:54 UTC | |
by angeloulivieri (Novice) on Mar 21, 2014 at 10:38 UTC |