春季有一些选项可供选择。你可以用任何一个。
@Autowired
private Environment env;
...
public String getTridelSuites() throws IOException, InterruptedException {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.GET()
.uri(URI.create(env.getProperty("suiteUrl");))//here
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
return response.body();
}