http client java

Solutions on MaxInterview for http client java by the best coders in the world

showing results for - "http client java"
Leon
18 Aug 2019
1HttpClient client = HttpClient.newHttpClient();
2HttpRequest request = HttpRequest.newBuilder()
3      .uri(URI.create("http://openjdk.java.net/"))
4      .build();
5client.sendAsync(request, BodyHandlers.ofString())
6      .thenApply(HttpResponse::body)
7      .thenAccept(System.out::println)
8      .join();