Http client API (original) (raw)

Ian Robertston ian.b.robertson at gmail.com
Wed Aug 8 12:09:34 PDT 2012


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.



More information about the net-dev mailing list