Net::T...Result(3pm)

πŸ“¦
version 4.01043 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– NAME πŸ’–

Net::Twitter::Role::WrapResult β€” ok bestie, this one's whole thing is wrapping up your Twitter API response and your HTTP Response together. It's giving two-for-one πŸ’…


✨ VERSION ✨

version 4.01043 πŸŽ€


🌸 SYNOPSIS 🌸

no cap, here's how you actually use it:

use Net::Twitter;

my $nt = Net::Twitter->new(
    traits => [ qw/API::RESTv1_1 WrapResult/ ],
    %other_new_options,
);

my $r = $nt->verify_credentials;

my $http_response        = $r->http_response;
my $twitter_result       = $r->result;
my $rate_limit_remaining = $r->rate_limit_remaining;

See? You get the HTTP response, the Twitter result, and the rate limit remaining all from one call. Obsessed. 😌


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜•

Normally, Net::Twitter API methods just hand you back the decoded JSON body from the HTTP response. Which is fine, like, it works. But β€” some genuinely useful info, notably the rate limit info, is chillin' in the HTTP response headers, not the body. And default behavior just… leaves it there. πŸ™ˆ

With this role applied, API methods will return a Net::Twitter::WrappedResult object instead. That object includes both the HTTP response and the decoded JSON response body β€” everything, together, in one place. Main character energy fr fr πŸ‘‘

Wanna know all the deets? See Net::Twitter::WrappedResult for the full breakdown.


🌈 AUTHOR 🌈

Marc Mims <marc@questright.com> β€” thank u for ur service 🫢


Copyright (c) 2016 Marc Mims


πŸŽ€ LICENSE πŸŽ€

This library is free software and may be distributed under the same terms as perl itself. ✨ (yes, literally just perl's terms β€” iconic of it tbh)


and that's the whole page bestie!! this one shipped as part of perl v5.34.0, dated 2022-06-16, and it lives in the User Contributed Perl Documentation section under the name Net::T...Result(3pm) πŸ’– slay, go wrap some results πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from