Try keeping the cookies:

$ua = LWP::UserAgent->new(cookie_jar=>{});

Bill's solution is good because you can persist the cookies. If you 
don't care to persist, then the a/m code should work.

卍刕卍 wrote:
> <code>
> my $address='http://bbs.abc.com/login';
> my $req = new HTTP::Request 'POST',"$address";
> $req->content_type('application/x-www-form-urlencoded');
> $req->content('username=abc&password=cba&submit=Login');
> $ua = LWP::UserAgent->new;
> $ua->agent("Robot/abc");
> my $res = $ua->request($req);
> print $res->as_string;
> </code>
>
> OK,here I can login the bbs,but I can't operate further by single 
> 'Get'/'Post' method.(Authorization Problem)
> So,how to use the cookie I got?
>
> -- 
> ------======Nerazzurri======------
> ------------------------------------------------------------------------
>
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to