我正在尝试在春季启动时发送带有RestTemplate的get,发送查询参数 在以下问题上:
String url = "https://X.X.X.X/X/X/loren/value?token={token}";
this.restTemplate.getForObject(url, String.class, "X");
并且在运行代码时出现以下错误:
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://X.X.X.X/X/X/loren/value": Connect to X.X.X.X:port [X.X.X.X/1.1.1.1] failed: Connection refused (Connection refused); nested exception is org.apache.http.conn.HttpHostConnectException: Connect to X.X.X.X:port [X.X.X.X/1.1.1.1] failed: Connection refused (Connection refused)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:751) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:677) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:318) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
据我所知,它没有向我发送参数。我有办法发送该参数吗? 谢谢