commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir D. Kolsky" <>
Subject RE: [httpclient] PostMethod.setRequestBody (was RE: HttpClient Post)
Date Wed, 24 Apr 2002 13:59:05 GMT
According to the documentation, an exception is to be thrown if the request body is set and
addParameter is to be called. This makes no sense, as there is no way to set the body... It
does, however, prove that the issue was raised at one point...

Perhaps the cleanest way is to create two mutually exclusive PostMethod subclasses by making
the current PostMethod abstract. One would be PostBodyMethod and the other PostParaemterMethod...

Changing the method name on a PutMethod to "POST" would, IMHO, be a bad programming practice.

Thanks, Amir

-----Original Message-----
From: Waldhoff, Rodney []
Sent: Wed, April 24, 2002 3:08 PM
To: 'Jakarta Commons Developers List '
Subject: [httpclient] PostMethod.setRequestBody (was RE: HttpClient


It's not entirely clear to me how the contract should work between
setRequestBody and setParameter. Both are trying to set the body for the
POST request, and doing so in incompatible ways.  What should the behavior
be? Throw an exception when one is called after the other has been already?
One overrides another?

An alternative may be to add setName() methods to HttpMethod or at least
HttpMethodBase, so that one could use a PUT method, and make it look like a
POST.  That way different behaviors live in different classes.


- Rod

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message