.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "WWW::OAuth::Request::Mojo 3pm" .TH WWW::OAuth::Request::Mojo 3pm "2022-12-06" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" WWW::OAuth::Request::Mojo \- HTTP Request container for Mojo::Message::Request .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 6 \& 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; \& }); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" WWW::OAuth::Request::Mojo is a request container for WWW::OAuth that wraps a Mojo::Message::Request object, which is used by Mojo::UserAgent. It performs the role WWW::OAuth::Request. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" WWW::OAuth::Request::Mojo implements the following attributes. .SS "request" .IX Subsection "request" .Vb 2 \& my $mojo_request = $req\->request; \& $req = $req\->request($mojo_request); .Ve .PP Mojo::Message::Request object to authenticate. .SH "METHODS" .IX Header "METHODS" WWW::OAuth::Request::Mojo composes all methods from WWW::OAuth::Request, and implements the following new ones. .SS "body_pairs" .IX Subsection "body_pairs" .Vb 1 \& my $pairs = $req\->body_pairs; .Ve .PP Return body parameters from \*(L"request\*(R" as an even-sized arrayref of keys and values. .SS "content" .IX Subsection "content" .Vb 2 \& my $content = $req\->content; \& $req = $req\->content(\*(Aqfoo=1&bar=2\*(Aq); .Ve .PP Set or return request content from \*(L"request\*(R". .SS "content_is_form" .IX Subsection "content_is_form" .Vb 1 \& my $bool = $req\->content_is_form; .Ve .PP Check whether \*(L"request\*(R" has single-part content and a \f(CW\*(C`Content\-Type\*(C'\fR header of \f(CW\*(C`application/x\-www\-form\-urlencoded\*(C'\fR. .SS "header" .IX Subsection "header" .Vb 2 \& my $header = $req\->header(\*(AqContent\-Type\*(Aq); \& $req = $req\->header(Authorization => \*(Aqfoo bar\*(Aq); .Ve .PP Set or return a request header from \*(L"request\*(R". .SS "method" .IX Subsection "method" .Vb 2 \& my $method = $req\->method; \& $req = $req\->method(\*(AqGET\*(Aq); .Ve .PP Set or return request method from \*(L"request\*(R". .SS "query_pairs" .IX Subsection "query_pairs" .Vb 1 \& my $pairs = $req\->query_pairs; .Ve .PP Return query parameters from \*(L"request\*(R" as an even-sized arrayref of keys and values. .SS "request_with" .IX Subsection "request_with" .Vb 5 \& my $tx = $req\->request_with($ua); \& $req\->request_with($ua, sub { \& my ($ua, $tx) = @_; \& ... \& }); .Ve .PP Run request with passed Mojo::UserAgent user-agent object, and return Mojo::Transaction object, as in \*(L"start\*(R" in Mojo::UserAgent. A callback can be passed to perform the request non-blocking. .SS "request_with_p" .IX Subsection "request_with_p" .Vb 4 \& my $p = $req\->request_with_p($ua)\->then(sub { \& my $tx = shift; \& ... \& }); .Ve .PP Run non-blocking request with passed Mojo::UserAgent user-agent object, and return a Mojo::Promise which will be resolved with the successful transaction or rejected on a connection error, as in \&\*(L"start_p\*(R" in Mojo::UserAgent. .SS "url" .IX Subsection "url" .Vb 2 \& my $url = $req\->url; \& $req = $req\->url(\*(Aqhttp://example.com/api/\*(Aq); .Ve .PP Set or return request \s-1URL\s0 from \*(L"request\*(R". .SH "BUGS" .IX Header "BUGS" Report any issues on the public bugtracker. .SH "AUTHOR" .IX Header "AUTHOR" Dan Book .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2015 by Dan Book. .PP This is free software, licensed under: .PP .Vb 1 \& The Artistic License 2.0 (GPL Compatible) .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Mojo::UserAgent