commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir D. Kolsky" <a...@kolsky.com>
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 [mailto:rwaldhof@us.britannica.com]
Sent: Wed, April 24, 2002 3:08 PM
To: 'Jakarta Commons Developers List '
Subject: [httpclient] PostMethod.setRequestBody (was RE: HttpClient
Post)


Re: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8458

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.

Thoughts?

- Rod

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message