WWW::OAuth::Request::HTTP_Request(3pm) | User Contributed Perl Documentation | WWW::OAuth::Request::HTTP_Request(3pm) |
WWW::OAuth::Request::HTTP_Request - HTTP Request container for HTTP::Request
my $req = WWW::OAuth::Request::HTTP_Request->new(request => $http_request); $req->request_with(LWP::UserAgent->new);
WWW::OAuth::Request::HTTP_Request is a request container for WWW::OAuth that wraps a HTTP::Request object, which can be used by several user-agents like LWP::UserAgent, HTTP::Thin, and Net::Async::HTTP. It performs the role WWW::OAuth::Request.
WWW::OAuth::Request::HTTP_Request implements the following attributes.
my $http_request = $req->request; $req = $req->request(HTTP::Request->new(GET => $url));
HTTP::Request object to authenticate.
WWW::OAuth::Request::HTTP_Request composes all methods from WWW::OAuth::Request, and implements the following new ones.
my $content = $req->content; $req = $req->content('foo=1&bar=2');
Set or return request content from "request".
my $bool = $req->content_is_form;
Check whether "request" has single-part content and a "Content-Type" header of "application/x-www-form-urlencoded".
my $header = $req->header('Content-Type'); $req = $req->header(Authorization => 'Basic foobar');
Set or return a request header from "request".
my $method = $req->method; $req = $req->method('GET');
Set or return request method from "request".
$http_response = $req->request_with(LWP::UserAgent->new);
Run request with passed user-agent object, and return HTTP::Response object. User-agent may be LWP::UserAgent, HTTP::Thin, or Net::Async::HTTP. If run with Net::Async::HTTP, the return value is a Future yielding the HTTP::Response object as in "do_request" in Net::Async::HTTP.
my $url = $req->url; $req = $req->url('http://example.com/api/');
Set or return request URL from "request".
Report any issues on the public bugtracker.
Dan Book <dbook@cpan.org>
This software is Copyright (c) 2015 by Dan Book.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
LWP::UserAgent, HTTP::Thin, Net::Async::HTTP
2018-12-19 | perl v5.28.1 |