lmocsi has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use LWP::UserAgent; use HTTP::Request; use utf8; my ($content,$decoded,$req,$res); my $url = "http://something"; my $ua = LWP::UserAgent->new; $req = HTTP::Request->new("GET", $url); $req->header('Content-Type' => 'application/json', 'Accept' => 'application/json, text/javascript, */*; q= +0.01' ); $res = $ua->request($req); $content = $res->content(); # First request done # New url $url = "http://something_else"; # What next?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to reuse a http::request object?
by Your Mother (Archbishop) on Dec 05, 2016 at 01:54 UTC | |
|
Re: How to reuse a http::request object?
by ikegami (Patriarch) on Dec 05, 2016 at 01:31 UTC | |
|
Re: How to reuse a http::request object?
by BrowserUk (Patriarch) on Dec 04, 2016 at 22:36 UTC |