#!/usr/local/bin/perl -w use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => $url); ##add some headers here## my $res = $ua->request($req); #### GET http://10.23.4.2:5988/myrest Accept: application/atom+xml Authorization: Basic dsfls;fjal;ksdf== User-Agent: libwww-perl/5.834 Content-Type: application/xml (no content) 500 read timeoutt Content-Type: text/plain Client-Date: Wed, 12 Jun 2013 04:10:56 GMT Client-Warning: Internal response 500 read timeoutt\n 500 read timeoutt Content-Type: text/plain Client-Date: Wed, 12 Jun 2013 04:10:56 GMT Client-Warning: Internal response 500 read timeoutt $VAR1 = bless( { '_content' => '500 read timeoutt ', '_rc' => 500, '_headers' => bless( { 'client-warning' => 'Internal response', 'client-date' => 'Wed, 12 Jun 2013 04:10:56 GMT', 'content-type' => 'text/plain' }, 'HTTP::Headers' ), '_msg' => 'read timeoutt', '_request' => bless( { '_content' => '', '_uri' => bless( do{\(my $o = 'http://10.23.4.2:5988/myrest')}, 'URI::http' ), '_headers' => bless( { 'user-agent' => 'libwww-perl/5.834', 'content-type' => 'application/xml', 'accept' => 'application/atom+xml', 'authorization' => 'Basic a;lsdfjjadfsafadf==' }, 'HTTP::Headers' ), '_method' => 'GET', '_uri_canonical' => $VAR1->{'_request'}{'_uri'} }, 'HTTP::Request' ) }, 'HTTP::Response' );