Created
March 4, 2009 05:35
-
-
Save mattn/73729 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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