WWW::O...t::Mojo(3pm)
π WWW::OAuth::Request::Mojo(3pm) π
okay bestie, welcome to WWW::OAuth::Request::Mojo(3pm) β the lil' request container that makes OAuth behave for your Mojo apps. she's giving User Contributed Perl Documentation energy and honestly? she ate. β¨
β¨ NAME β¨
WWW::OAuth::Request::Mojo β HTTP Request container for Mojo::Message::Request. yeah. that's the whole vibe. π
β¨ SYNOPSIS β¨
my $req = WWW::OAuth::Request::Mojo->new(request => $mojo_request);
my $ua = Mojo::UserAgent->new;
my $tx = $req->request_with($ua);
$req->request_with_p($ua)->then(sub {
my $tx = shift;
});
look at her go π¦ three lines and you're already doing OAuth. iconic.
β¨ DESCRIPTION β¨
so WWW::OAuth::Request::Mojo is a request container for WWW::OAuth β it wraps a Mojo::Message::Request object, which is the thing Mojo::UserAgent uses under the hood. π§
basically, it performs the role WWW::OAuth::Request. that's her job. she does it. periodt. π
β¨ ATTRIBUTES β¨
WWW::OAuth::Request::Mojo implements the following attributes. (yes, one whole attribute. quality over quantity, fr fr. π
)
β¨ request β¨
my $mojo_request = $req->request;
$req = $req->request($mojo_request);
the Mojo::Message::Request object you're authenticating. that's the one. that's the girl. π«Ά
β¨ METHODS β¨
WWW::OAuth::Request::Mojo composes all the methods from WWW::OAuth::Request β so you get the whole squad β and then implements the following new ones on top. π
β¨ body_pairs β¨
my $pairs = $req->body_pairs;
gives you back the body parameters from "request" as an even-sized arrayref of keys and values. even-sized. always. don't come at her with an odd one. π
β¨ content β¨
my $content = $req->content;
$req = $req->content('foo=1&bar=2');
set or return the request content from "request". she's flexible like that. π
β¨ content_is_form β¨
my $bool = $req->content_is_form;
checks whether "request" has single-part content and a Content-Type header of application/x-www-form-urlencoded. returns a bool. slay. β
β¨ header β¨
my $header = $req->header('Content-Type');
$req = $req->header(Authorization => 'foo bar');
set or return a request header from "request". yes, including Authorization. that's literally the whole point of her existence, bestie. π₯
β¨ method β¨
my $method = $req->method;
$req = $req->method('GET');
set or return the request method from "request". GET, POST, whatever you're feeling today. main character energy. π
β¨ query_pairs β¨
my $pairs = $req->query_pairs;
returns the query parameters from "request" as an even-sized arrayref of keys and values. same deal as body_pairs but for the query string. π
β¨ request_with β¨
my $tx = $req->request_with($ua);
$req->request_with($ua, sub {
my ($ua, $tx) = @_;
...
});
runs the request with the Mojo::UserAgent user-agent object you pass in, and returns a Mojo::Transaction object β exactly like "start" in Mojo::UserAgent. you can also pass a callback to perform the request non-blocking. β¨
β¨ request_with_p β¨
my $p = $req->request_with_p($ua)->then(sub {
my $tx = shift;
...
});
runs a non-blocking request with the passed Mojo::UserAgent user-agent object and returns a Mojo::Promise. that promise gets resolved with the successful transaction, or rejected on a connection error β just like "start_p" in Mojo::UserAgent. promises, but make it cute. π
β¨ url β¨
my $url = $req->url;
$req = $req->url('http://example.com/api/');
set or return the request URL from "request". where are we going? we're going there. π¦
β¨ BUGS β¨
report any issues on the public bugtracker. don't suffer in silence, bestie, that's not the vibe. π
β¨ AUTHOR β¨
Dan Book <dbook@cpan.org> β the legend herself. π
β¨ COPYRIGHT AND LICENSE β¨
This software is Copyright (c) 2015 by Dan Book.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
free software, free vibes, no cap. π
β¨ SEE ALSO β¨
Mojo::UserAgentβ go read her too, iykyk. π
perl v5.40.1 Β· 2025-08-10 Β· mwah π that's the whole page, bestie β go authenticate something iconic. periodt. πβ¨ππ¦πΈπ π«Άππβ
π¦ where this page comes from
- ubuntu resolute: libwww-oauth-perl 1.003-1 Β· Artistic-2.0
- ubuntu stonking: libwww-oauth-perl 1.003-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms