in reply to Re^2: Problem with LWP::UserAgent
in thread Problem with LWP::UserAgent
use strict; use LWP::UserAgent; use HTTP::Headers; my $ua = LWP::UserAgent->new( 'agent' => 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537 +.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36' ); my $hdr = HTTP::Headers->new( 'Content-Type' => 'text/plain', 'Content-Length' => 0, ); my $url = "https://www.7digital.com/"; my $req = HTTP::Request->new(GET => $url, $hdr); my $res = $ua->request($req); if ($res->is_success) { print $res->decoded_content; } else { die $res->status_line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Problem with LWP::UserAgent
by Paradigma (Novice) on Jun 23, 2019 at 20:31 UTC | |
by holli (Abbot) on Jun 23, 2019 at 20:55 UTC | |
by Paradigma (Novice) on Jun 24, 2019 at 11:25 UTC | |
by holli (Abbot) on Jun 25, 2019 at 05:49 UTC |