Bio-EnsEMBL
view release on metacpan or search on metacpan
lib/Bio/EnsEMBL/Utils/Net.pm view on Meta::CPAN
return $response->{content} if length $response->{content};
return;
}
sub _get_lwp {
my ($url) = @_;
throw "Cannot perform action as LWP::UserAgent is not available" unless $LWP;
my $ua = LWP::UserAgent->new();
$ua->env_proxy;
my $response = $ua->get($url);
return $response->decoded_content if $response->is_success;
return;
}
sub _get_lwp_to_file {
my ($url, $filename) = @_;
throw "Cannot perform action as LWP::UserAgent is not available" unless $LWP;
throw "Filename required for download to proceed." unless $filename;
my $ua = LWP::UserAgent->new();
$ua->env_proxy;
my $response = $ua->get($url, ":content_file" => $filename);
( run in 0.269 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )