HTTP::Tiny::Mech - Wrap a WWW::Mechanize instance in an HTTP::Tiny compatible interface.
version 1.001002
# Get something that expects an HTTP::Tiny instance # to work with HTTP::Mechanize under the hood. # my $thing => ThingThatExpectsHTTPTiny->new( ua => HTTP::Tiny::Mech->new() ); # Get something that expects HTTP::Tiny # to work via WWW::Mechanize::Cached # my $thing => ThingThatExpectsHTTPTiny->new( ua => HTTP::Tiny::Mech->new( mechua => WWW::Mechanize::Cached->new( ) ); );
This code is somewhat poorly documented, and highly experimental.
Its the result of a quick bit of hacking to get MetaCPAN::API working faster via the WWW::Mechanize::Cached module ( and gaining cache persistence via CHI )
MetaCPAN::API
WWW::Mechanize::Cached
CHI
It works so far for this purpose.
At present, only "get" and "request" are implemented, and all other calls fall through to a native HTTP::Tiny.
HTTP::Tiny
mechua
This class provides one non-standard parameter not in HTTP::Tiny, mechua, which is normally an autovivified WWW::Mechanize instance.
WWW::Mechanize
You may override this parameter if you want to provide a custom instance of a WWW::Mechanize class.
Interface should be the same as it is with "get" in HTTP::Tiny.
Interface should be the same as it is with "request" in HTTP::Tiny
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentnl@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::Mech, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Tiny::Mech
CPAN shell
perl -MCPAN -e shell install HTTP::Tiny::Mech
For more information on module installation, please visit the detailed CPAN module installation guide.