in reply to "406 not acceptable" errors with LWP::UserAgent::get
Seems the main thing it doesn’t like is the agent. Your code gave me the same error, even tweaked and pruned down until I swapped the agent for something that isn’t, apparently, blacklisted.
use 5.10.0; use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent('DomoArigato/3.0'); my $url = 'http://makeoursmarvel.com/feed/podcast/'; my $response = $ua->get($url); say $response->is_success ? "OK!" : $response->as_string; __END__ OK!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: "406 not acceptable" errors with LWP::UserAgent::get
by thomas895 (Deacon) on Aug 18, 2020 at 00:34 UTC | |
by Your Mother (Archbishop) on Aug 18, 2020 at 01:14 UTC | |
by jimhenry (Acolyte) on Aug 18, 2020 at 20:18 UTC | |
by Your Mother (Archbishop) on Aug 18, 2020 at 23:57 UTC |
In Section
Seekers of Perl Wisdom