1public void get(String uri) throws Exception {
2 HttpClient client = HttpClient.newHttpClient();
3 HttpRequest request = HttpRequest.newBuilder()
4 .uri(URI.create(uri))
5 .build();
6
7 HttpResponse<String> response =
8 client.send(request, BodyHandlers.ofString());
9
10 System.out.println(response.body());
11}