Hi there, I am using libwww perl library to access a site.
I have two problem, 1. When trying to print the received content it is producing malformed headers, as follows; HTTP/1.1 200 OK Cache-Control: private Connection: close Date: Tue, 24 Sep 2002 07:48:52 GMT Server: Microsoft-IIS/5.0 Content-Length: 1359 Content-Type: text/html Client-Date: Tue, 24 Sep 2002 08:44:50 GMT Client-Response-Num: 1 The headers seems ok but, even after this, it is producing malformed headers err. 2. The returning page have another form, after login to second form I will get the desired page. How can I submit two forms using libwww, Do I have to use HTML::Form for second??? # Code use LWP::UserAgent; use HTTP::Cookies; use HTTP::Request::Common; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file =>'cookie_jar', autosave => 1)); my $r = $ua->simple_request(POST "http://www.myserver.com/MyFile.asp", { passwd => 'pass', mngrid => 'uid', 'SUBMIT!!' => 'SUBMIT!!', }); my $nIndex = 0; while ($r->is_redirect) { my $u = $r->header('location') or die "missing location: ", $r->as_string; $u = "http://www.myserver.com/" . $u ; #print "redirecting to $u\n"; $r = $ua->simple_request(GET $u); $nIndex++; } print $r->as_string;
