hi:
1、i use HttpURLConnection login ,then remember cookie
     url = new URL("
http://passport.cnfol.com/accounts/Login?username=ouwx&password=account88&act=login&usertype=0&return=http://www.cnfol.com
?");
     httpurlconnection = (HttpURLConnection) url.openConnection();
     httpurlconnection.setRequestProperty("User-Agent", "Mozilla/4.0
(compatible; MSIE 5.0; Windows XP; DigExt)");
httpurlconnection.setDoOutput(false);
httpurlconnection.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
httpurlconnection.connect();
BufferedReader in = new BufferedReader(new
InputStreamReader(httpurlconnection.getInputStream()));
String inputLine;

while ((inputLine = in.readLine()) != null)
       {
 String session_value = httpurlconnection.getHeaderField("Set-Cookie");
 sessionId = session_value.split(";");
}

2、use the cookie to get the content
httpurlconnection = (HttpURLConnection) url.openConnection();
      httpurlconnection.setRequestProperty("Proxy-Authorization", " Basic
");
      httpurlconnection.setRequestProperty("User-Agent", "Mozilla/4.0
(compatible; MSIE 5.0; Windows XP; DigExt)");
      httpurlconnection.setRequestProperty("Cookie", sessionId[0]);
              httpurlconnection.setDoOutput(false);

 
httpurlconnection.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
              httpurlconnection.connect();
              BufferedReader in = new BufferedReader(new
InputStreamReader(httpurlconnection.getInputStream()));


my problem is:i can use cookie get the content at local  ,but at
sever(upload to google) i cann't get the content.

why?local diffrent server?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to