.\" 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::Basic 3pm" .TH WWW::OAuth::Request::Basic 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::Basic \- HTTP Request container for HTTP::Tiny .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& my $req = WWW::OAuth::Request::Basic\->new(method => \*(AqPOST\*(Aq, url => $url, content => $content); \& $req\->request_with(HTTP::Tiny\->new); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" WWW::OAuth::Request::Basic is a request container for WWW::OAuth that stores the request parameters directly, for use with user-agents that do not use request objects like HTTP::Tiny. It performs the role WWW::OAuth::Request. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" WWW::OAuth::Request::Basic implements the following attributes. .SS "content" .IX Subsection "content" .Vb 2 \& my $content = $req\->content; \& $req = $req\->content(\*(Aqfoo=1&bar=2\*(Aq); .Ve .PP Request content string. .SS "headers" .IX Subsection "headers" .Vb 2 \& my $headers = $req\->headers; \& $req = $req\->headers({}); .Ve .PP Hashref of request headers. Must be updated carefully as headers are case-insensitive. Values can be array references to specify multi-value headers. .SS "method" .IX Subsection "method" .Vb 2 \& my $method = $req\->method; \& $req = $req\->method(\*(AqGET\*(Aq); .Ve .PP Request method. .SS "url" .IX Subsection "url" .Vb 2 \& my $url = $req\->url; \& $req = $req\->url(\*(Aqhttp://example.com/api/\*(Aq); .Ve .PP Request \s-1URL.\s0 .SH "METHODS" .IX Header "METHODS" WWW::OAuth::Request::Basic composes all methods from WWW::OAuth::Request, and implements the following new ones. .SS "content_is_form" .IX Subsection "content_is_form" .Vb 1 \& my $bool = $req\->content_is_form; .Ve .PP Check whether \*(L"headers\*(R" contains a \f(CW\*(C`Content\-Type\*(C'\fR header set to \&\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 => \*(AqBasic foobar\*(Aq); .Ve .PP Set or return a request header in \*(L"headers\*(R". .SS "set_form" .IX Subsection "set_form" .Vb 1 \& $req = $req\->set_form({foo => \*(Aqbar\*(Aq}); .Ve .PP Convenience method to set \*(L"content\*(R" to a urlencoded form. Equivalent to: .PP .Vb 3 \& use WWW::OAuth::Util \*(Aqform_urlencode\*(Aq; \& $req\->header(\*(AqContent\-Type\*(Aq => \*(Aqapplication/x\-www\-form\-urlencoded\*(Aq); \& $req\->content(form_urlencode $form); .Ve .SS "request_with" .IX Subsection "request_with" .Vb 1 \& my $res = $req\->request_with(HTTP::Tiny\->new); .Ve .PP Run request with passed HTTP::Tiny user-agent object, and return response hashref, as in \*(L"request\*(R" in HTTP::Tiny. .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" HTTP::Tiny