HTTP::Retry - Wrapped HTTP::Tiny with timeout and retry
use HTTP::Retry qw(http); $response = http("http://www.example.com"); $response = http('url' => 'http://www.example.com', 'timeout' => 1, 'retry' => 10, 'sleep' => 1); print $response->{status}; print $response->{content} if $response->{success};
Another HTTP client library.
LWP is too complex and too slow.
HTTP::Tiny and Furl is wonderful, but no autoretry.
HTTP::Retry resolves this, then make your code clearer.
Enjoy it!
Easy write and understand with 3 seconds timeout and 3 times retry.
my $response = http("http://www.example.com"); print $response->{content};
Set timeout and retry times as your wish.
my $response = http('url' => 'http://www.example.com', 'timeout' => 1, 'retry' => 10, 'sleep' => 1); print $response->{content};
HTTP::Tiny, Furl, Hijk
Chen Gang, <yikuyiku.com@google.com>
Copyright (C) 2014 by Chen Gang
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.2 or, at your option, any later version of Perl 5 you may have available.
To install HTTP::Retry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Retry
CPAN shell
perl -MCPAN -e shell install HTTP::Retry
For more information on module installation, please visit the detailed CPAN module installation guide.