Http client API (original) (raw)
Michael McMahon michael.x.mcmahon at oracle.com
Thu Aug 16 05:16:18 PDT 2012
- Previous message: Http client API
- Next message: Http client API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 08/08/12 20:09, Ian Robertston wrote:
Instead of HttpRequest having
void setBody(Iterable buffers, boolean isRestartable) what about having two methods: void setBody(Iterable buffers) // presumed restartable void setBody(Iterator buffers) // clearly not restartable Not only does this avoid a potentially confusing boolean parameter, but it also avoids forcing people to create "dishonest" Iterables, where they know the iterator() method cannot be called more than once. - Ian Ian,
Thanks for the comment. I agree this is probably the way to do it. Having two separate methods gives scope to explain the difference clearly in the javadoc.
- Michael.
- Previous message: Http client API
- Next message: Http client API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]