Priority can be set for HttpClient with HTTP/1.1
Chris Hegarty
chris.hegarty at oracle.com
Wed Aug 8 13:31:00 UTC 2018
Hi Nezih,
The client’s version is a default preferred version for requests that do not specify an explicit version. As such, it does not prevent requests, attempting to negotiate HTTP/2, from being sent, just that it is not the default. Given that, then the priority value is still be applicable to client’s build with a preferred HTTP/1.1 version.
-Chris.
> On 1 Aug 2018, at 10:56, nezih yigitbasi <nezihyigitbasi at gmail.com> wrote:
>
> 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
More information about the net-dev
mailing list