develooper Front page | perl.libwww | Postings from October 2001

Get a page whick is written in Servelet

Thread Next
From:
qmi
Date:
October 6, 2001 12:08
Subject:
Get a page whick is written in Servelet
Message ID:
86256ADD.0068E948.00@utm-notesob1.mdacc.tmc.edu


Hi, All:
     I tried to get a page which is written by Java Servelet using LWP. The web
site is protected by username and password. Here is my code:

  $ua=LWP::UserAgent->new;
  $req=HTTP::Request->new
(POST=>'http://hostname.com/servlet/com.hostname.servlets.PortalProxy');
  $req->content_type('application/x-www-form-urlencoded');
   $req->authorization_basic('username', 'password');
$req->content('field1=value1&field2=value2&field3=value3');
  my $res =  $ua->request($req);

But when I run my code, the "$res" has nothing in the content. I print the head
of response and it shows as following:

 HTTP/1.1 302 (Found) Moved Temporarily
Cache-Control: no-cache="set-cookie,set-cookie2"
Connection: Close
Connection: close
Date: Sat, 06 Oct 2001 19:05:51 GMT
Location:
http://cds.hostname.com/cdsError.jsp?errCode=4103&jrunsessionid=1279831002395152193

Server: Netscape-Enterprise/4.1
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Client-Date: Sat, 06 Oct 2001 19:08:09 GMT
Client-Peer: 63.89.199.25:80
Set-Cookie: BIGipServer=2147526848.20480.0000; expires=Sat, 06-Oct-2001 19:10:02
 GMT; path=/
Set-Cookie: jrunsessionid=1279831002395152193;path=/

Could somebody tell why and how to solve this problem? I do appreciate your
help. Thank you



Qing



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About