Jerry Kassebaum wrote:
> The code below is modified from Suehring's "Beginning Perl Web Development".
> I'm thinking it is supposed to get me the format for entering my username
> and password. However, the result I get is "2".
>
> Help?
>
> Also, I don't know what that "Subscrbers" line would be for.
>
>
> use LWP;
>
> $browser = LWP::UserAgent->new();
>
> $result = $browser->credentials('https://optionsxpress.com/login.asp',
> 'Subscribers',
> 'myname' => 'badpassword');
>
> print "$result";
This should work for at least basic authentication after filling your
values in for user/pass :
use strict;
use warnings;
use LWP::UserAgent;
my $url = 'https://optionsxpress.com/login.asp';
my $user = '';
my $pass = '';
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(GET => $url);
$req->authorization_basic($user, $pass);
print $ua->request($req)->as_string;
__END__
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs