Skip to content

Instantly share code, notes, and snippets.

@mattn
Created March 4, 2009 05:35
Show Gist options
  • Save mattn/73729 to your computer and use it in GitHub Desktop.
Save mattn/73729 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use URI;
use LWP::UserAgent;
use HTTP::Request::Common;
my $url = 'http://localhost/localstart.asp';
my $ua = new LWP::UserAgent(keep_alive=>1);
print $ua->credentials('localhost:80', '', "domain\\username", 'password')."\n";
my $request = GET $url;
my $response = $ua->request($request);
if ($response->is_success) {print "It worked!->" . $response->code . "\n"}
else {print "It didn't work!->" . $response->code . "\n"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment