7) About Mikes idea for having two different classes for stream posting and parameters posting. I don't really like what that does to the public interface. Its already fat when it comes to parameters, and conceptually it is just a POST method.
Here is another idea. Using streams is the general case, and the parameters is the special case. Treat the parameters as a stream.

Right now, there is a shitload of methods for dealing with those stupid parameters:
addParameter(NameValuePair)
addParameter(string, string)
addParameters(NameValuePair[])
removeParameter(string)
removeParameter(string, string)
setParameter(string, string) deprecated

The client really does not need so much access to the parameters and this is classic interface bloat. All the client needs is:
setRequestBody(String stringBody)
setRequestBody(InputStream streamBody)
setRequestBody(NameValuePair[] parametersBody)
Agreed.  This would certainly make things a lot cleaner.

They are mutually exclusive right? You can't have more than one body, and parameters are url encoded to make the body. They should all have the same method name, so it is clear that they all set the same thing, in different ways.

Right now, PostMethod is very anal. If you call setRequestBody, and then addParameters, it throws an IllegalStateException. Thats lame. Its awkward, there is no obvious relationship between setRequestBody and addParameters but they are still mutually exclusive.
Do you envision multiple calls to setRequestBody() still causing an IllegalStateException.

I like this idea. It will successfully simplify PostMethod without removing and real functionality.

Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to