#!/usr/bin/perl use LWP::UserAgent; use HTTP::Request::Common; use LWP::Debug qw(+); use Authen::NTLM; use strict; use warnings; ntlmv2(1); my $url = "http://10.1.1.1"; my $ua = new LWP::UserAgent(keep_alive => 1); $ua->credentials('10.1.1.1:80', '', 'myDomain\\user', 'password'); my $req = GET $url; print "--Peforming request now...---------\n"; my $res = $ua->request($req); if ($res->is_success) { print $res->content; } else { print "Error: " . $res->status_line . "\n"; print $res->headers()->as_string(), "\n"; } exit 0;
In reply to Re: How to select NTLM authentication with LWP
by Khen1950fx
in thread How to select NTLM authentication with LWP
by tiedwu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |