HTTP::Tiny::Patch::Plugin - Change use of HTTP::Tiny to that of HTTP::Tiny::Plugin
This document describes version 0.001 of HTTP::Tiny::Patch::Plugin (from Perl distribution HTTP-Tiny-Patch-Plugin), released on 2019-04-14.
First, invoke this patch. From Perl:
use HTTP::Tiny::Patch::Plugin # -set_plugins => ['Cache', CustomRetry=>{strategy=>"Exponential", strategy_options=>{initial_delay=>0.5, max_delay=>300}}], ;
or:
use HTTP::Tiny::Patch::Plugin; HTTP::Tiny::Plugin->set_plugins('Cache', ...);
From command-line:
% HTTP_TINY_PLUGINS='["Cache","CustomRetry",{"strategy":"Exponential","strategy_options":{"initial_delay":0.5}}]' \ perl -MHTTP::Tiny::Patch::Plugin script-that-uses-http-tiny.pl ...
Now every usage of HTTP::Tiny, e.g.:
my $response = HTTP::Tiny->new->get("http://www.example.com/");
will become:
my $response = HTTP::Tiny::Plugin->new->get("http://www.example.com/");
This module replaces every instantiation of HTTP::Tiny to instantiate HTTP::Tiny::Plugin instead, so you can use HTTP::Tiny::Plugin's plugins. Note that instantiation of other HTTP::Tiny subclasses, e.g. HTTP::Tiny::Cache is not replaced with instantiation of HTTP::Tiny::Plugin.
Array. Will be passed to HTTP::Tiny::Plugin's set_plugins(). You can also set plugins by calling set_plugins() yourself.
set_plugins()
Please visit the project's homepage at https://metacpan.org/release/HTTP-Tiny-Patch-Plugin.
Source repository is at https://github.com/perlancar/perl-HTTP-Tiny-Patch-Plugin.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=HTTP-Tiny-Patch-Plugin
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
HTTP::Tiny::Plugin
HTTP::Tiny
Module::Patch
perlancar <perlancar@cpan.org>
This software is copyright (c) 2019 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install HTTP::Tiny::Patch::Plugin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Tiny::Patch::Plugin
CPAN shell
perl -MCPAN -e shell install HTTP::Tiny::Patch::Plugin
For more information on module installation, please visit the detailed CPAN module installation guide.