commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@bluewin.ch
Subject RE: [httpclient] session after autentication
Date Tue, 14 Oct 2003 09:12:17 GMT
Albert,
Could you please post the wire log in its entirety?

What I can see from the snippet is that HttpClient must drop connection because
the target server violates the HTTP protocol by not sending content length
information. This can well be the cause of your problem.


Oleg


>-- Original Message --
>Reply-To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
>From: "Albert Caramia" <a_caramia@hotmail.com>
>To: commons-user@jakarta.apache.org
>Subject: RE: [httpclient] session after autentication
>Date: Tue, 14 Oct 2003 11:05:56 +0200
>
>
>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" <commons-user@jakarta.apache.org>
>>To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
>>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
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message