in reply to Get url

And farther on

#!/usr/bin/perl use strict; use warnings; use LWP; my $url = "https://www.earthquake.usgs.gov/earthquakes/feed/v1.0/sum +mary/2.5_week.atom"; my $ua; $ua = new LWP::UserAgent(keep_alive=>1 ,agent =>"Mozilla/5.0 (Windows NT 5.1; rv:51 +.0) Gecko/20100101 Firefox/51.0" ,ssl_opts => { verify_hostname => 0 , SSL_verify_mode => 'SSL_VERIF +Y_NONE' } # ,timeout=>$timeout ); my $req = new HTTP::Request (GET => $url); my $response = $ua->request ($req); unless ($response->is_success) { die $response->status_line; }
result
404 Not Found at 1189178a.pl line 20.

Replies are listed 'Best First'.
Re^2: Get url
by pryrt (Abbot) on Apr 29, 2017 at 22:31 UTC

    with my browser (on my phone right now, so no easy perl), I verified that while https gives 404, http gives atom file. kepler should try your error-checking with correct protocol.