I do all the points (on get and on post request), I use the new RC2 but nothing changes.
httpclient.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
httpclient.getHostConfiguration().setProxy("myLocalProxy",8080);PostMethod post = new PostMethod("http://www.smsexecutive.it/new/index1.php");
NameValuePair[] data = {
new NameValuePair("username", "user"),
new NameValuePair("password", "pass"),
new NameValuePair("Submit", "Invia")
};
post.setRequestHeader("Accept","image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*");
post.setRequestHeader("Accept-Language","it,en;q=0.5");
post.setRequestHeader("Referer","http://www.smsexecutive.it/new/dx.php");
post.setRequestHeader("Pragma","no-cache");
post.setRequestHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)");
post.setHttp11(false);
post.setStrictMode(true);
the header now is the same and the response for the first post request is equals.
but I see after the post request this warning in the log
2003/10/14 10:59:16:977 CEST [DEBUG] wire - ->> "Proxy-Connection: Keep-Alive[\r][\n]"
....
2003/10/14 10:57:29:125 CEST [WARN] HttpMethodBase - -Response content length is not known
2003/10/14 10:57:29:125 CEST [DEBUG] HttpMethodBase - -Force-close connection: true
...then the html...
2003/10/14 10:57:29:203 CEST [DEBUG] HttpMethodBase - -Should force-close connection.
2003/10/14 10:57:29:203 CEST [DEBUG] HttpMethodBase - -Default charset used: ISO-8859-1
2003/10/14 10:57:29:219 CEST [DEBUG] HttpConnection - -Connection is stale, closing...
2003/10/14 10:57:29:219 CEST [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0)
2003/10/14 10:57:29:219 CEST [DEBUG] HttpMethodBase - -Execute loop try 1
can be this the problem? the connection is close after the first post so the second get request is not in the same session?
I see the method methodbase.setConnectionCloseForced but i can't do post.setConnectionCloseForced(false) because is protected.
there is a workaround? is this way right? can I try to change the source?
Thanks Albert
From: [EMAIL PROTECTED] Reply-To: "Jakarta Commons Users List" <[EMAIL PROTECTED]> To: "Jakarta Commons Users List" <[EMAIL PROTECTED]> Subject: RE: [httpclient] session after autentication Date: Mon, 13 Oct 2003 18:09:23 +0200
Albert,
1) Set up HttpClient to send requests via the proxy
(HttpClient#getHostConfiguration#setProxy)
2) Use HTTP/1.0 (GetMethod#setHttp11(false))
3) Use strict mode (GetMethod#setStrictMode(true)). That will make HttpClient
put all cookies in one header.
Let me know how it all works out.
Oleg
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
