$ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "cookies.txt",autosave => 1)); my $req = HTTP::Request->new(POST => 'http://www.cacti.kobra.ktu.lt/index.php'); $req->content_type('application/x-www-form-urlencoded'); $req->content('login_username='.$login.'&login_password='.$passw.'&action=login'); my $res = $ua->request($req); sleep(3); my $req = HTTP::Request->new(GET => 'http://www.cacti.kobra.ktu.lt/tree.php?action=item_edit&parent_id=254&tree_ id=12&type_select=2'); my $res = $ua->request($req); my $data = $res->as_string;
In reply to Re^4: Passing a cookie with LWP::UserAgent
by kyoshu
in thread Passing a cookie with LWP::UserAgent
by nedals
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |