in reply to Re^2: XML::LibXML Parser Error
in thread XML::LibXML Parser Error
Failure of HTTP requests hasn't been new since 1991 ;-) so test the response:
use LWP; my $url = 'http://feeds.feedburner.com/oreilly/perl?format=xml'; my $agent = LWP::UserAgent->new; my $request = HTTP::Request->new(GET => $url); $request->content_type('application/xml'); my $response = $agent->request($request); if ($response->is_success) { print "HTTP response is good\n"; # Parse XML here } else { die "Awooga! HTTP request failed with ". $response->status_line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: XML::LibXML Parser Error
by omegaweaponZ (Beadle) on Mar 07, 2014 at 16:56 UTC | |
by hippo (Archbishop) on Mar 07, 2014 at 17:01 UTC | |
by omegaweaponZ (Beadle) on Mar 07, 2014 at 18:12 UTC | |
by Anonymous Monk on Mar 08, 2014 at 08:23 UTC |