commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dylan Stamat <dyl...@gmail.com>
Subject Re: Commons HttpClient: HttpClient#setConnectionTimeout
Date Thu, 03 Mar 2005 00:23:41 GMT
Here's a new one for all of you :)

I've got a PostMethod object, and I'm calling setRequestBody() with an
array of NameValuePair objects... ie:

==========
PostMethod post = new PostMethod(url);
post.setRequestBody(nameValuePairArray);
==========

This is all fine and dandy, however, the host I'm posting this to is
unable to parse encoded data.
The NameValuePair's are encoded by default... but, I'm unable to find
a way to ensure they AREN'T encoded.

I checked out URIUtil, and it has a decode() method... but the process
would then be a lot less straightforward if I had to break up the URL
and piece-meal it back together.

Any ideas ?



On Wed, 2 Mar 2005 17:13:30 -0500, Scott Heaberlin <heabdogg@gmail.com> wrote:
> You are exactly right.  eggOnMe = true
> 
> Further investigation showed that I was not setting the read (so)
> timeout as I thought. Then when I actually *was* setting soTimeout, I
> found a bug in our own application that was ignoring the timeout value
> from my own configuration - so instead of my expected "quick" timeout,
> httpclient was being set to a normal, much longer timeout.  I simply
> wasn't waiting long enough for our default timeout value to expire.
> 
> Consequently, I opted to do what one of the previous messages in this
> thread suggested - utilize HttpMethod::abort() to achieve an absolute
> timeout, as our business requirements do not differentiate from
> connection timeout or remote read timeout.  For this I have now
> utilized a mechanism very similar to httpclient's own
> TimeoutController class combined with HttpMethod::abort().  This
> approach works wonderfully - ending the http operation regardless of
> the state of the connection or read operations.
> 
> Thanks a bunch - and sorry for the confusion.
> 
> -Scott
> 
> ---------------------------------------------------------------------
> 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