Hi,
I'm trying to write a script in Perl to download a file that requires NTLM authentication to access, stored on a machine on this network.
I'm trying to get this
http://search.cpan.org/~gaas/libwww-...lm.pm#SYNOPSIS
to work, but it simply won't.
Code:
use LWP::UserAgent;
use HTTP::Request::Common;
my $url = 'http://machine:port/file.pdf';
# Set up the ntlm client and then the base64 encoded ntlm handshake message
my $ua = LWP::UserAgent->new(keep_alive=>1);
$ua->credentials('http://machine:port/', '', 'machine\\username', 'userpass');
my $request = new HTTP::Request GET => $url;
print "--Performing request now...-----------\n";
my $response = $ua->request($request);
print "--Done with request-------------------\n";
if ($response->is_success) {print "It worked!->" . $response->code . "\n"}
else {print "It didn't work!->" . $response->code . "\n"}
Any suggestions as to how I'd go about debugging this?
The file exists, and can be accessed through a web-browser, btw.