online java http request demo

Solutions on MaxInterview for online java http request demo by the best coders in the world

showing results for - "online java http request demo"
Juno
18 Nov 2017
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}
similar questions
queries leading to this page
online java http request demo