Skip to content

Instantly share code, notes, and snippets.

@ahndmal
Created November 26, 2020 18:37
Show Gist options
  • Save ahndmal/2bfd03b421f1135a001e9b420c341dad to your computer and use it in GitHub Desktop.
Save ahndmal/2bfd03b421f1135a001e9b420c341dad to your computer and use it in GitHub Desktop.
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://postman-echo.com/get"))
.version(HttpClient.Version.HTTP_2)
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandler.asString());
assertThat(response.version(), equalTo(HttpClient.Version.HTTP_1_1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment