in reply to Re: login???
in thread LWP and Logging into webpages

i tried this to experiment... the goal was to get the content of my default page once ive logged in into $content
#!/usr/bin/perl use strict; use HTTP::Request; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(POST=>'http://perlmonks.com/index.pl'); $req->authorization_basic('maddfisherman', '********'); my $content = $ua->request($req)->as_string;
but this just gives me the default page not my page after i log in.

Replies are listed 'Best First'.
Re: Re: Re: login???
by joealba (Hermit) on Jun 23, 2002 at 14:26 UTC
    Perlmonks doesn't use web server authorization like that. It's all cgi script-based authentication based on cgi params or cookies.
    # UNTESTED use HTTP::Request; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(POST=>'http://perlmonks.com/index.pl?op=l +ogin;user=maddfisherman;passwd=******'); my $content = $ua->request($req)->as_string;
    And if you're thinking of writing a votebot, don't. :)
      i tried it... this also returns the perlmonks homepage.
        Correct. You should get the perlmonks homepage, just like you would if you went to http://www.perlmonks.org/ and then logged in.

        What is it that you're trying to get?
Re: Re: Re: login???
by crazyinsomniac (Prior) on Jun 23, 2002 at 05:02 UTC