bowei_99 has asked for the wisdom of the Perl Monks concerning the following question:
I'm hoping not to have to use SOAP::Lite, as it would seem overkill. I only have to check that the http protocol is available on the port I specify. Telnetting to the port should work, in theory, but I'd really rather prefer something that gets a real HTTP response.
use LWP; use HTTP::Request; my $req = HTTP::Request->new(GET => 'http://ip-address/axis2/services/ +Service1:8082'); my $ua = LWP::UserAgent->new; my $res = $ua->request($req); if (($res->is_success) or ($res->status_line =~ /404 Not Found/)){ print "HTTP OK - connected\n\n"; } else { print "HTTP ERROR " . $res->status_line, " \n\n"; }
-- Burvil
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why does HTTP::Request change the port I specify?
by moritz (Cardinal) on Apr 13, 2008 at 16:44 UTC | |
Re: Why does HTTP::Request change the port I specify?
by Corion (Patriarch) on Apr 13, 2008 at 16:45 UTC |