MetaCP...::HasUA(3pm)

✨ MetaCP...::HasUA ✨

okay so bestie, welcome to MetaCPAN::Client::Role::HasUA πŸ’– β€” aka the role that handles your user-agent situation. It's from the User Contributed Perl Documentation corner of the perl world, and it's lowkey iconic. Let's get into it 🫢


🌸 VERSION 🌸

version 2.044000 ✨ (yes, that's the whole version number, she's specific)


πŸŽ€ ATTRIBUTES πŸŽ€

πŸ’… ua

my $mcpan = MetaCPAN::Client->new( ua => HTTP::Tiny->new(...) );

So this is the user agent object that actually goes out there and runs your requests. She's the one doing the work, the main character of the network call πŸ’«

The way that it works: it must provide an interface that matches HTTP::Tiny. Like, explicitly, no wiggle room:

  • Implement post() β€” there has to be a post method available that accepts a request URL and a hashref of options.
  • Implement get() β€” there has to be a get method available that accepts a request URL.
  • Return result hashref β€” it must return a result hashref which has the key success and the key content.

Default: HTTP::Tiny 🌈 (she comes pre-installed, we love a no-effort setup)

🌟 ua_args

my $mcpan = MetaCPAN::Client->new(
    ua_args => [ agent => 'MyAgent' ],
);

These are the arguments sent to the user agent β€” like, all the little extras you wanna pass along to her so she knows how to behave πŸŽ€

Default: user agent string: MetaCPAN::Client/$version.


πŸ‘‘ AUTHORS πŸ‘‘

  • Sawyer X <xsawyerx@cpan.org>
  • Mickey Nasriachi <mickey@cpan.org>

This software is copyright (c) 2016 by Sawyer X.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. fr fr, it's free, go wild πŸ¦‹


ngl bestie, if you're swapping in your own ua, double-check she's got post() and get() and returns that success + content hashref β€” otherwise it's giving broken and the request will simply not slay πŸ’€

perl v5.40.1 Β· 2026-07-05 Β· MetaCP...::HasUA(3pm) β€” that's the whole vibe, thanks for reading, mwah πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from