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!

In reply to LWP 500 Internal response read timeout by vhn2000

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.