1
0
mirror of https://github.com/c-kr/check_json.git synced 2024-11-23 19:03:49 +01:00

Enable proxy support for the HTTP(S) request

The 'env_proxy' option automatically loads proxy settings from *_proxy environment variables, if they are defined. This behaviour is consistent with other tools such as curl, wget, etc.
This commit is contained in:
David Mat 2015-07-13 18:28:09 +02:00
parent 125e30842f
commit 327a941657

View File

@ -100,6 +100,7 @@ if ($np->opts->verbose) { (print Dumper ($np))};
## GET URL ## GET URL
my $ua = LWP::UserAgent->new; my $ua = LWP::UserAgent->new;
$ua->env_proxy;
$ua->agent('check_json/0.5'); $ua->agent('check_json/0.5');
$ua->default_header('Accept' => 'application/json'); $ua->default_header('Accept' => 'application/json');
$ua->protocols_allowed( [ 'http', 'https'] ); $ua->protocols_allowed( [ 'http', 'https'] );