WWW::O...Request(3pm)
β¨ WWW::OAuth::Request β bestie edition π
okay so this is the WWW::OAuth::Request page from the User Contributed Perl Documentation, and she is an HTTP Request container role and she is iconic. sit down, grab a strawberry π, we're doing this.
πΈ NAME πΈ
WWW::OAuth::Request β HTTP Request container role. that's her. that's the whole name. short, sweet, main character energy π
β¨ SYNOPSIS β¨
like, here's the vibe check:
use Role::Tiny::With;
with 'WWW::OAuth::Request';
that's it. you with it and suddenly you're a request container. slay.
π DESCRIPTION π
okay so WWW::OAuth::Request is a Role::Tiny role, right, and what she does is give WWW::OAuth a consistent interface for parsing and authenticating requests. no cap. if you want the specifics β the actual gritty details of what a request container needs to be β go look at "HTTP REQUEST CONTAINERS" in WWW::OAuth. she's not gonna repeat herself here, periodt.
π¦ METHODS π¦
WWW::OAuth::Request implements or requires the following methods. yes, "or requires" β some of these are homework you have to do yourself, bestie, and she will absolutely let you know which ones. π
π body_pairs
my $pairs = $req->body_pairs;
returns the body parameters out of "application/x-www-form-urlencoded" "content" β and it hands them back as an even-sized arrayref of keys and values. so like key, value, key, value, alternating forever. it's giving very organized. π
π content
my $content = $req->content;
$req = $req->content('foo=1&baz=2');
sets or returns the request content. that's it, that's the method. but here's the thing β you must implement this one for the role to compose. it's a requirement, not a suggestion. π₯
π content_is_form
my $bool = $req->content_is_form;
checks whether the content is single-part and the content type is "application/x-www-form-urlencoded". returns a bool. also must be implemented to compose the role β so yeah, another one you're on the hook for. π«Ά
π header
my $header = $req->header('Content-Type');
$req = $req->header('Content-Type' => 'application/x-www-form-urlencoded');
sets or returns a request header. you can set multiple values by passing an array reference as the value β and when you ask for multi-value headers back, they get joined on ", ". cute little comma-space moment. also: must be implemented to compose the role. β¨
π method
my $method = $req->method;
$req = $req->method('GET');
sets or returns the request method. GET, POST, whatever you're feeling. must be implemented to compose the role. π
π query_pairs
my $pairs = $req->query_pairs;
returns the query parameters from "url" as an even-sized arrayref of keys and values. same alternating key-value energy as body_pairs but for the URL. consistency?? we love her. π§
π request_with
my $res = $req->request_with($ua);
sends the request using the passed user-agent object and returns the response. must be implemented to compose the role. yes bestie, this is the one that actually does the thing. π
π url
my $url = $req->url;
$req = $req->url('http://example.com/api/');
sets or returns the request URL. must be implemented to compose the role. and that's the last required one β you made it. π
π BUGS π
report any issues on the public bugtracker. please don't suffer in silence, that's not the vibe. π«Ά
π AUTHOR π
Dan Book <dbook@cpan.org> β actual legend.
π 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?? we love to see it. π
β SEE ALSO β
HTTP::RequestMojo::Message::Request
go read those too, iykyk. π
and that's the whole page, bestie π this was WWW::O...Request(3pm) from perl v5.40.1, dated 2025-08-10. thanks for reading, you ate that. 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