WWW::O...Request(3pm)
β¨ NAME β¨
WWW::OAuth::Request::HTTP_Request β it's the HTTP Request container for HTTP::Request, bestie π
Like, it's the little wrapper that holds your HTTP::Request so WWW::OAuth can do its thing. iykyk.
π¦ SYNOPSIS π¦
my $req = WWW::OAuth::Request::HTTP_Request->new(request => $http_request);
$req->request_with(LWP::UserAgent->new);
literally two lines and you're done, we love a low-effort slay π
πΈ DESCRIPTION πΈ
okay so WWW::OAuth::Request::HTTP_Request is a request container for WWW::OAuth β it wraps an HTTP::Request object π
and the reason that's iconic is that a bunch of different user-agents can use it: LWP::UserAgent, HTTP::Thin, and Net::Async::HTTP all play nice with it π«Ά
it performs the role WWW::OAuth::Request. that's its whole job. it shows up, does the role, serves. main character energy fr fr π
π ATTRIBUTES π
WWW::OAuth::Request::HTTP_Request implements the following attributes. yes bestie, there's only one, and it's a good one β
π request
my $http_request = $req->request;
$req = $req->request(HTTP::Request->new(GET => $url));
the HTTP::Request object that we're gonna authenticate π that's it, that's the attribute, it's giving "small but mighty" π
π§ METHODS π§
WWW::OAuth::Request::HTTP_Request composes all the methods from WWW::OAuth::Request (so you get those for free, no cap) and then implements the following new ones β¨
π
content
my $content = $req->content;
$req = $req->content('foo=1&bar=2');
set or return the request content from "request" π¦ yes, the quotes around request are on purpose, it's referring to that attribute up there, we're being precise about it.
π 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 π
so like, it's a yes/no vibe check on whether this thing is form-encoded. returns a bool. cute π
π¦ header
my $header = $req->header('Content-Type');
$req = $req->header(Authorization => 'Basic foobar');
set or return a request header from "request" π¬ like, get one, or set one, your call bestie.
π method
my $method = $req->method;
$req = $req->method('GET');
set or return the request method from "request" π οΈ GET, POST, whatever you're feeling, it's your moment.
π₯ request_with
$http_response = $req->request_with(LWP::UserAgent->new);
okay this one is the actual moment β it runs the request with the user-agent object you pass in, and returns an HTTP::Response object π
the user-agent may be LWP::UserAgent, HTTP::Thin, or Net::Async::HTTP π«Ά
β οΈ heads up bestie, there's a lil plot twist: if you run it withNet::Async::HTTP, the return value is aFutureyielding theHTTP::Responseobject β same as in"do_request"inNet::Async::HTTPπ so don't just go grabbing the response off it directly, okay? async said "not today".
π url
my $url = $req->url;
$req = $req->url('http://example.com/api/');
set or return the request URL from "request" π where are we going? you decide.
π BUGS π
report any issues on the public bugtracker π (please be nice, Dan is one person and he's doing great)
πΈ AUTHOR πΈ
Dan Book <dbook@cpan.org> π
π 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)
slay, it's free, go wild but legally π
β SEE ALSO β
LWP::UserAgentHTTP::ThinNet::Async::HTTP
and that's the whole page bestie!! πΈ this one came from the Perl docs β perl v5.40.1, dated 2025-08-10 π«Ά go forth and authenticate your requests, you absolute icon ππβ¨
π¦ 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