Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8175814

Update default HttpClient protocol version and optional request version

XMLWordPrintable

    • b168
    • Verified

        The HTTP protocol version is an enum with two values for 1.1 and 2.

        Currently, the protocol version can be set in either the client or then overridden in the request. If not set in the request, then the value belonging to the client is used when the request is sent, and then the HttpResponse can be queried to see which version was used.

        However, what should HttpRequest.version() return if no version was specified in the builder? We don't know what value is set in the client until the request is sent via a particular client.

        One possibility is to add a HTTP_UNSPECIFIED value to the version enum.

        Or else HttpRequest::version() could return Optional<Version> where Optional is empty if it was not set on the request.

              michaelm Michael McMahon
              michaelm Michael McMahon
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: