in reply to Re: LWP::UserAgent Get timing out after few request
in thread LWP::UserAgent Get timing out after few request

Thanks but had not luck I increased the sleep time to 10 and 15 made no difference. Also played around with timeout (both increasing and decreasing seem to make no difference)
  • Comment on Re^2: LWP::UserAgent Get timing out after few request

Replies are listed 'Best First'.
Re^3: LWP::UserAgent Get timing out after few request
by Your Mother (Archbishop) on Aug 17, 2017 at 15:48 UTC

    Is this a public API that any of us could play with or something closed or paid?

      unfortunately it is an closed API (else I would have gladly posted the URL)...on another note I tried using the REST::Client instead of LWP::UserAgent and it worked that is it did not time out.

      sub getUserInfov { my($userId) = @_; my $userURI = 'https://xxx.com/api/m1/request/'. $partnerId. '/users/ + print $userURI, "\n"; my $client = REST::Client->new(); $client->addHeader('Authorization', $authHeaders); $client->GET($userURI); # my $userContent = decode_json( $client->responseContent()); # print Dumper($userContent); print 'Response: ' . $client->responseContent() . "\n"; print 'Response status: ' . $client->responseCode() . "\n"; foreach ( $client->responseHeaders() ) { print 'Header: ' . $_ . '=' . $client->responseHeader($_) . "\n"; } # return ($userContent); #sleep (3); }