hi all,
I've read through several similar posts regarding this problem but still haven't been able to find an answer for my situation.
I wanted to clarify that my system doesn't have any proxy setting. my system is Linux.
So I have a simple program to consume a restful webservice.
#!/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);
When i ran this code, it timed out( i increased timeout still not solving the issue). I was able to consume this url with a PHP script i wrote. I also used other 3rd party restful api(firefox addon, java app) on the same url with no issue.
so i took it further by setting up wireshark and ran the perl script. when i looked at the packets, it seemd like all the relevant data was passed back to my system. But some how the LWP library(/usr/local/share/perl5/LWP/Protocol/http.pm at function "can_read") was not able to get the end of message.
Below is the Dumper of the Response object and handler from UserAgent.
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-a
+gent' => 'libwww-perl/5.834',
'conten
+t-type' => 'application/xml',
'accept
+' => 'application/atom+xml',
'author
+ization' => 'Basic a;lsdfjjadfsafadf=='
}, 'HTTP:
+:Headers' ),
'_method' => 'GET',
'_uri_canonical' => $VAR1->{'_
+request'}{'_uri'}
}, 'HTTP::Request' )
}, 'HTTP::Response' );
Any insights would be greatly appreciated.
Thanks!