Priority can be set for HttpClient with HTTP/1.1

nezih yigitbasi nezihyigitbasi at gmail.com
Wed Aug 1 09:56:08 UTC 2018


Hi,
Priority is only defined for version HTTP_2 (and that's clear from the
javadoc). However, it's possible to construct an instance of HttpClient
with a priority value and with version HTTP_1_1 (tested with Java "9.0.1").
I feel that it will be less error prone for the users if conflicting
combinations of arguments weren't allowed. It's also confusing when I read
the below code as it doesn't make sense to set the priority for HTTP/1.1.
What do you think?

HttpClient client = HttpClient.newBuilder()
        .executor(httpClientExecutor)
        .priority(32)
        .version(HTTP_1_1)
        .build();

Thanks,
Nezih
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20180801/76a5b286/attachment.html>


More information about the net-dev mailing list