Perl Lwp Error 500 Read Timeout
Contents |
RecentThreads NewestNodes Donate What'sNew on Jun 15, 2010 at 12:46UTC ( #844855=perlquestion: print w/replies, xml ) Need Help?? bharat88 has asked for the wisdom of the Perl Monks concerning the following question: Hi monks, My query is similar to : http://www.perlmonks.org/?node_id=781476 I have basically written
Perl Useragent Timeout
a code to download a file from the net. The link works when tried 500 read timeout error from a browser. But, not using the below script: #!/usr/local/bin/perl -w use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req
500 Ssl Read Timeout Error
= HTTP::Request->new(GET => $url); my $res = $ua->request($req); if($res->is_success){ print $res->is_success."\n"; my @data = split '\n', $res->content; foreach my $line (@data){ print $line."\n"; } } else{ my @data = split '\n', $res->content; print $res->status_line . perl lwp useragent 500 read timeout "\n"; print $res->as_string . "\n"; my $err = sprintf "(%d)(%s)(%d)(%s)\n", $!,$!,$^E,$^E; print "Err: $err\n"; print "\n\n\n\\n\n\n"; for my $i(0 .. 256){ $! = $i; $^E = $i; printf "(%d)(%s)(%d)(%s)\n", $!,$!,$^E,$^E; } } [download] The only problem is that I cannot mention the URL used. Here is the output: 500 read timeout 500 (Internal Server Error) read timeout Content-Type: text/plain Client-Date: Tue, 15 Jun 2010 12:19:02 GMT Client-Warning: Internal response 500 lwp::useragent ssl read timeout Err: (0)()(0)() Any idea if this is a server side problem, or a client-side? Sure looks like a sever side, but the link works externally. Also, the file is being downloaded if I use curl. Thanks, Bharat. Comment on LWP 500 read timeoutDownload Code Replies are listed 'Best First'. Re: LWP 500 read timeout by duff (Vicar) on Jun 15, 2010 at 13:27UTC Um ... I don't see where you set $url in your code.And it looks like you have warnings and stricture turned on, so you should get an appropriate error message for not declaring $url. duff [reply][d/l][select] Re^2: LWP 500 read timeout by bharat88 (Initiate) on Jun 15, 2010 at 14:57UTC Hey duff, Like I said, I can't mention the URL. But I have defined it in my code. [reply] Re: LWP 500 read timeout by ahmad (Hermit) on Jun 16, 2010 at 01:17UTC My guess, You forgot to load HTTP::Request module. Which is not required for your script and I have absolutely no idea why you're using it while the only thing you need is already included in LWP::UserAgent module a simple $ua->get would the job just fine, you don't need to build a request yourself.[reply][d/l] Re^2: LWP 500 read timeout by Anonym
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Perl Http::request
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 500 SSL read timeout error in LWP perl up vote 0 down http://www.perlmonks.org/?node_id=844855 vote favorite I have a perl script which will post HTTP request to specified server URL (Say: http://some-ip/here_action_url ). My problem is, Sometimes I am getting the below error. Error: 500 SSL read timeout. Sample Code: my $ua = new LWP::UserAgent; $ua->timeout(30); my $res = $ua->post( $url, { 'data' => $my_data } ); if(! $res->is_success ) { # Error Logging print $res->status_line."\n"; } else { $response_content = $res->content; } http://stackoverflow.com/questions/26400010/500-ssl-read-timeout-error-in-lwp-perl I read about the error. Most of the documents are saying that it is because of the response delay in server side. I just want to confirm, whether this error is coming because of server response delay? (or) Can be the problem with my perl script? perl lwp-useragent share|improve this question asked Oct 16 '14 at 8:48 vara 228316 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote If you get a result some of the time, and the error at other times, then it looks like your code is working. If you alway get the 500 error, it indicates a connection problem. Would need to know more about the service you are trying to connect to, does it require certificates or other authentication (which may be needed for secure socket layer connection) share|improve this answer answered Oct 16 '14 at 10:23 Kim Ryan 3721210 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms o
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or http://stackoverflow.com/a/26401978 posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 500 SSL read timeout error in LWP perl up vote 0 down vote favorite I have a perl script which will post HTTP request to specified server URL (Say: http://some-ip/here_action_url ). My problem is, Sometimes I read timeout am getting the below error. Error: 500 SSL read timeout. Sample Code: my $ua = new LWP::UserAgent; $ua->timeout(30); my $res = $ua->post( $url, { 'data' => $my_data } ); if(! $res->is_success ) { # Error Logging print $res->status_line."\n"; } else { $response_content = $res->content; } I read about the error. Most of the documents are saying that it is because of the response delay in server side. I just want to confirm, whether this error is coming because of server response 500 read timeout delay? (or) Can be the problem with my perl script? perl lwp-useragent share|improve this question asked Oct 16 '14 at 8:48 vara 228316 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote If you get a result some of the time, and the error at other times, then it looks like your code is working. If you alway get the 500 error, it indicates a connection problem. Would need to know more about the service you are trying to connect to, does it require certificates or other authentication (which may be needed for secure socket layer connection) share|improve this answer answered Oct 16 '14 at 10:23 Kim Ryan 3721210 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged perl lwp-useragent or ask your own question. asked 2 years ago viewed 1154 times active 2 years ago Related 0Using Perl LWP::UserAgent with XML that requires Usernames and Passwords to connect2perl LWP: connection timeout different from request timeout7Using LWP with SSL and client certificates4Please help me debug an SSL issue using WWW::Mechanize (or LWP::UserAgent for that matter)1Perl LWP close connection manually0Perl LWP::UserAgen