Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 62119 invoked from network); 14 Oct 2003 09:06:17 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 14 Oct 2003 09:06:17 -0000 Received: (qmail 89262 invoked by uid 500); 14 Oct 2003 09:05:44 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 89221 invoked by uid 500); 14 Oct 2003 09:05:43 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 89192 invoked from network); 14 Oct 2003 09:05:43 -0000 Received: from unknown (HELO hotmail.com) (65.54.245.115) by daedalus.apache.org with SMTP; 14 Oct 2003 09:05:43 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 14 Oct 2003 02:05:57 -0700 Received: from 81.116.217.210 by by1fd.bay1.hotmail.msn.com with HTTP; Tue, 14 Oct 2003 09:05:56 GMT X-Originating-IP: [81.116.217.210] X-Originating-Email: [a_caramia@hotmail.com] From: "Albert Caramia" To: commons-user@jakarta.apache.org Bcc: Subject: RE: [httpclient] session after autentication Date: Tue, 14 Oct 2003 11:05:56 +0200 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 14 Oct 2003 09:05:57.0101 (UTC) FILETIME=[6110B1D0:01C39232] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Oleg, 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: olegk@bluewin.ch >Reply-To: "Jakarta Commons Users List" >To: "Jakarta Commons Users List" >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: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org