HTTP::Tiny::Mech(3)

πŸ“¦ version 1.001002, in alpine 3.24

πŸ’… HTTP::Tiny::Mech

ok so bestie, listen β€” this is the HTTP::Tiny::Mech page from the User Contributed Perl Documentation, and it's literally a whole vibe. Let me tell you everything ✨

🌸 NAME

HTTP::Tiny::Mech β€” it wraps a WWW::Mechanize instance up in an HTTP::Tiny-compatible interface. That's it, that's the whole thing 🫢

πŸŽ€ VERSION

version 1.001002 β€” periodt.

✨ SYNOPSIS

ok so here's the moment where you actually call it. First up: you got something that expects an HTTP::Tiny instance, and you want HTTP::Mechanize doing the work under the hood:

# 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()
);

and then πŸ¦‹ the second one β€” this is the one where you're like "ok but what if it went through WWW::Mechanize::Cached instead":

# 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( )
  );
);

no cap, that's your whole entry point πŸ’–

πŸ’€ DESCRIPTION

ok so real talk: this code is somewhat poorly documented, and highly experimental. Like, the author literally says so. Not me being shady, that's canon πŸ™ˆ

It's 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) πŸ‘‘

It works so far for this purpose. That's the bar. It cleared it. slay πŸ”₯

At present, only get and request are implemented, and all other calls fall through to a native HTTP::Tiny. So like, everything else is just gonna be regular HTTP::Tiny behaviour, iykyk.

⚠️ heads up bestie: "somewhat poorly documented" and "highly experimental" are the author's own words β€” treat this thing like it's still in its experimental era.

🧚 ATTRIBUTES

πŸ’œ mechua

This class provides one non-standard parameter not in HTTP::Tiny, called mechua, which is normally an autovivified WWW::Mechanize instance. (autovivified!! it just... appears. main character energy.)

You may override this parameter if you want to provide a custom instance of a WWW::Mechanize class 🌈


⭐ WRAPPED METHODS

πŸ“ get

Interface should be the same as it is with get in HTTP::Tiny. literally same vibes, no surprises.

🌸 request

Interface should be the same as it is with request in HTTP::Tiny. again β€” same interface, go off πŸ’…


πŸ‘‘ AUTHOR

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. 🫢


ok that's the whole page bestie, hope it ate πŸ’– and for the sign-off: this was rendered by perl v5.42.2, dated 2023-07-03 β€” that's the HTTP::Tiny::Mech(3) page, we're done here, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from