use HTTP::Tiny; my $url = 'https://<my-url>'; my $headers = { Accept => "application/json", 'Content-Type' => "application/json", Authorization => "user:password" }; my $response = HTTP::Tiny->new->get($url, { headers => $headers }); if ($response->{success}) { my $html = $response->{content}; print "$html\n"; } else { print "failure: $response->{status}\n"; } This prints 401
In reply to Re^2: Not sure how to use HTTP::Tiny
by plx
in thread Not sure how to use HTTP::Tiny
by plx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |