Furl::Request - Request object for Furl
my $f = Furl->new; my $req = Furl::Request->new($method, $uri, $headers, $content); my $res = $f->request($req); print $req->request_line, "\n"; my $http_req = $req->as_http_request; my $req_hash = $req->as_hashref;
This is a HTTP request object in Furl.
my $req = Furl::Request->new($method, $uri); # or my $req = Furl::Request->new($method, $uri, \%headers); # or my $req = Furl::Request->new($method, $uri, \%headers, $content); # and my $req = Furl::Request->parse($http_request_raw_string);
Gets/Sets HTTP request method
Gets/Sets request URI
Gets/Sets instance of Furl::Headers
Gets/Sets request body in scalar.
$req->protocol('HTTP/1.1'); print $req->protocol; #=> "HTTP/1.1"
Gets/Sets HTTP protocol in string.
Shorthand to access Furl::Headers.
Make instance of HTTP::Request from Furl::Request.
Convert request object to HashRef.
Format is following:
method: Str uri: Str protocol: Str headers: ArrayRef[Str] content: Str
print $req->request_line; #=> "GET / HTTP/1.1"
Returns HTTP request line.
To install Furl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Furl
CPAN shell
perl -MCPAN -e shell install Furl
For more information on module installation, please visit the detailed CPAN module installation guide.