|
NAMEWWW::OAuth::Request::Mojo - HTTP Request container for Mojo::Message::RequestSYNOPSISmy $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; }); DESCRIPTIONWWW::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.ATTRIBUTESWWW::OAuth::Request::Mojo implements the following attributes.requestmy $mojo_request = $req->request; $req = $req->request($mojo_request); Mojo::Message::Request object to authenticate. METHODSWWW::OAuth::Request::Mojo composes all methods from WWW::OAuth::Request, and implements the following new ones.body_pairsmy $pairs = $req->body_pairs; Return body parameters from "request" as an even-sized arrayref of keys and values. contentmy $content = $req->content; $req = $req->content('foo=1&bar=2'); Set or return request content from "request". content_is_formmy $bool = $req->content_is_form; Check whether "request" has single-part content and a "Content-Type" header of "application/x-www-form-urlencoded". headermy $header = $req->header('Content-Type'); $req = $req->header(Authorization => 'foo bar'); Set or return a request header from "request". methodmy $method = $req->method; $req = $req->method('GET'); Set or return request method from "request". query_pairsmy $pairs = $req->query_pairs; Return query parameters from "request" as an even-sized arrayref of keys and values. request_withmy $tx = $req->request_with($ua); $req->request_with($ua, sub { my ($ua, $tx) = @_; ... }); Run request with passed Mojo::UserAgent user-agent object, and return Mojo::Transaction object, as in "start" in Mojo::UserAgent. A callback can be passed to perform the request non-blocking. request_with_pmy $p = $req->request_with_p($ua)->then(sub { my $tx = shift; ... }); 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 "start_p" in Mojo::UserAgent. urlmy $url = $req->url; $req = $req->url('http://example.com/api/'); Set or return request URL from "request". BUGSReport any issues on the public bugtracker.AUTHORDan Book <dbook@cpan.org>COPYRIGHT AND LICENSEThis software is Copyright (c) 2015 by Dan Book.This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) SEE ALSOMojo::UserAgent
Visit the GSP FreeBSD Man Page Interface. |