This took just over 3 minutes (default timeout). Why didn't the timeout of 10 seconds kick in?
Note I cannot reproduce as the internal server error is fixed, but I want to avoid the lengthy timeout in future
Using perl 5.8.0, here is code snippet:
my $method = 'POST'; my $url = "https://etc"; # note: actual url not shown here my $query_string = ""; # note: actual query string not shown here my $ua = new LWP::UserAgent; $ua->timeout(10); $ua->agent('Mozilla/4.6'); $ua->cookie_jar(HTTP::Cookies->new); $request = new HTTP::Request($method,$url); $request->content_type('application/x-www-form-urlencoded'); $request->content($query_string); $response_content = $ua->request($request)->content; LWP::Debug::debug("Response:\n$response_content\n");
Debug messages are as follows:
LWP::UserAgent::new: () LWP::UserAgent::proxy: LWP::UserAgent::request: () LWP::UserAgent::send_request: POST <URL here> LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::UserAgent::request: Simple response: Internal Server Error Response: 500 Connect failed: connect: Connection timed out; Connection timed ou +t
In reply to LWP::UserAgent request ignores timeout when internal server error encountered by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |