hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre John Mas <aj...@newtradetech.com>
Subject Re: Order of methods in PostMethod
Date Fri, 11 Apr 2003 14:56:45 GMT
Part of the reason that, I feel that, this would not be obvious
to most people is that you set up the PostMethod before submitting to 
the HttpClient to be executed.

In a live execution I would understand that order makes a big 
difference, but when you fill out an object that feels like defining
the values of a Java Bean this likely to be less obvious.

Andre

Kalnichevski, Oleg wrote:
> Andre,
> 
> This problem is what some people refer to as 'code modality'. You have to know the right
'mode' in order to make things work right. If not an outright bug this is definitely a design
flaw. I have been aware of this problem for quite a while. I'd just hoped that the 'mode'
was somehow obvious and did not quite warrant a fix. However, I have come to realize that
there could be situations that may lead to very ugly problems:
> 
>  post.setRequestHeader("Content-Type","text/xml; charset=UTF-8");
>  post.setRequestBody(content);
>  // Ahh. I have a sudden change of heart       
>  post.setRequestHeader("Content-Type","text/xml; charset=whatever");
>  // As a result we going to get complete garbage on the server-side
> 
> I'll be working on a patch
> 
> Cheers
> 
> Oleg
> 
[snip - see archives for the rest]



Mime
View raw message