hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Httpclient 3.1 encodes null=null parameters under stressing conditions
Date Thu, 11 Dec 2008 16:15:11 GMT
On 11/12/2008, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Wed, 2008-12-10 at 13:33 +0000, Domet De Mont, Dominique (d3m) wrote:
>  > Dear List,
>  >
>  > I am facing a strange httpclient 3.1 behaviour under stressing conditions while
encoding a post: the set of parameters is "nullified", whereas the number of parameters is
correct.
>  >
>  > I have turned on the httpclient wire traces to get more clues, and added in my
own code a dump of the PostMethod object before and after the httpclient.execute call: I see
the actual parameters correctly set in the PostMethod object, but actually the httpclient
encoding "nullified" parameters.
>  >
>  > Here is the code excerpt:
>  > synchronized(this) {
>  >     // Check parameters before call
>  >     log.debug("About to call httpclient.executeMethod on object: " + postMethodM
+ " containing parameters: " );
>  >     for(int i=0; i < postMethodM.getParameters().length; i++)
>  >         log.debug("\t" + i + "/ " + postMethodM.getParameters()[i].getName() +
"=" + postMethodM.getParameters()[i].getValue() );
>  >     // actually call
>  >     statusCodeM = httpclient.executeMethod(postMethodM);
>  >     // check parameters after call
>  >     log.debug("Called httpclient.executeMethod on object: " + postMethodM + " with
status: " + statusCodeM + " containing parameters: " );
>  >     for(int i=0; i < postMethodM.getParameters().length; i++)
>  >         log.debug("\t" + i + "/ " + postMethodM.getParameters()[i].getName() +
"=" + postMethodM.getParameters()[i].getValue() );
>  > }
>  >
>
>
> Do not do that. HttpMethods are not threading safe.

Not sure I follow - surely it is OK to call the methods in the same
thread, as in the sample above?

> Just turn on the
>  wire log if you need to examine what gets sent across the wire.
>
>  Oleg
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

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


Mime
View raw message