Hi,
i have problems with cookies, the cookies will be saved but
not sended. Can anybody help me?


sub request_post {
        my($url,$content,$post)[EMAIL PROTECTED];
        use LWP::UserAgent;
        use HTTP::Cookies::Netscape;
        my($cookie)=HTTP::Cookies->new(file =>
"/tmp/cookies.txt",autosave => 1,);
        my($ua)=new LWP::UserAgent();
        $ua->cookie_jar($cookie);
        $ua->agent("Mozilla 5.0/Linux");
        $ua->proxy(['http', 'ftp'],
'http://www-proxy.t-online.de:80/');    
        my($req);
        if ($post) { $req=new HTTP::Request('POST',$url) } else {
$req=new HTTP::Request('GET',$url) }
        $req->content_type('application/x-www-form-urlencoded');
        if ($content) {$req->content($content) }
        $req=$ua->prepare_request($req);
        my $res=$ua->request($req);
        if ($res->is_success) { return $res->content() } 
        else { open(ERROR,">/tmp/LWP.$$.ERROR"); print ERROR
"$url?$content\n\n$ret" ; close(ERROR) }
}


cu Peter

http://hbrks.homelinux.org/index.cgi
AOL/Yahoo: hbrks/MSN: [EMAIL PROTECTED]/ICQ: 33747569


-------------------------------------------------
This mail sent through IMP: http://hbrks.homelinux.org/horde/


----- Ende der weitergeleiteten Nachricht -----


-------------------------------------------------
This mail sent through IMP: http://hbrks.homelinux.org/horde/

Reply via email to