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
In reply to Re: Problem with HEAD.. but I think can be related with DNS
by Your Mother
in thread Problem with HEAD.. but I think can be related with DNS
by angeloulivieri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |