hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: replacement for deprecated startsession
Date Wed, 17 Nov 2004 08:57:15 GMT
Jilles,

There's no replacement for startSession. HTTP is a request/response
oriented protocol that does not (ugly hack called cookies
notwithstanding) support the concept of a session. 

Please refer to the HttpClient tutorial for details on recommended use
patterns

http://jakarta.apache.org/commons/httpclient/tutorial.html

Cheers,

Oleg


On Wed, Nov 17, 2004 at 09:44:06AM +0100, Jilles van Gurp wrote:
> Hi,
> 
> I have the following piece of code:
> URL url = new URL(location);
> HttpClient client = new HttpClient();
> client.startSession(url);
> 
> Since startSession is deprecated I thought that I could replace it with 
> the following line:
> client.getHostConfiguration().setHost(url.getHost());
> 
> However that doesn't seem to work and we get an error about a problem 
> with connecting to the host. The javadoc doesn't say anything more than 
> to use getHostConfiguration which is what I'm doing so could you please 
> inform me of the correct way to replace the startSession call?
> 
> Regards,
> 
> Jilles van Gurp
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

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


Mime
View raw message