📅  最后修改于: 2022-03-11 14:52:36.903000             🧑  作者: Mango
public void get(String uri) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(uri))
.build();
HttpResponse response =
client.send(request, BodyHandlers.ofString());
System.out.println(response.body());
}