vhn2000 has asked for the wisdom of the Perl Monks concerning the following question:
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.#!/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);
Any insights would be greatly appreciated. Thanks!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' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP 500 Internal response read timeout
by derby (Abbot) on Jun 12, 2013 at 11:51 UTC | |
by vhn2000 (Initiate) on Jun 12, 2013 at 16:44 UTC | |
by derby (Abbot) on Jun 13, 2013 at 09:57 UTC | |
by vhn2000 (Initiate) on Jun 13, 2013 at 18:03 UTC | |
by vhn2000 (Initiate) on Jun 13, 2013 at 18:48 UTC |