Http client API

Chris Hegarty chris.hegarty at oracle.com
Thu Aug 9 11:15:52 PDT 2012


Michael,

Looking good, some comments.

1) Why the use of CookieManager, rather than CookieHandler?  I  would
    expect that CookieHandler would be a cleaner API

2) What is the impact on the sendHeader, setBody for HEAD requests?

3) I think HttpClient could be an interface and move the create method
    to a builder/factory, and make it as immutable as possible ( this
    came up a few times now ).

4) The Filter API looks a little funny, in that filter instances are
    added to the client, while the ByteBufferWrapper instances are
    presumably created by the implementation after registering the
    wrapper class with the filter instance. Probably best/cleaner
    to use the same style. It could also be an interface.

5) ByteBufferWrapper seems a little cluttered with implementation detail
    setSource() nor setWrapper()?? Maybe best to just provide an
    interface.

6) Upgrade handler, similar comment to 4. Why not just register an
    instance.

7) Exposing the filter list seems a little wrong, given the getter/
    setter style.

8) java.net.httpclient.HttpConnectionCache.CachedConnection should
    probably be an interface.

9) How does the cache handle tunnels? endpoint address/proxy/etc

10) Missing fluent style return from HttpRequest.setRequestBodyLimit

11) Should sendHeaders be specified to allow a null return value. I'm
     thinking about when setSendExpectContinue is set.

-Chris.


On 08/08/12 00:09, Michael McMahon wrote:
> Hi,
>
> A new revision of the Http client API planned for jdk 8 can be viewed
> at the following link
>
> http://cr.openjdk.java.net/~michaelm/httpclient/v0.3/
>
> We would like to review the api on this mailing list.
> So, all comments are welcome.
>
> Thanks
> Michael McMahon.



More information about the net-dev mailing list