WWW::O...t::Mojo(3pm)

πŸ“¦
version 1.003 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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. ⭐

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. πŸ‘‘


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