【发布时间】:2019-07-12 07:53:20
【问题描述】:
我有来自 Spring Boot 的以下功能。我不能使用声明式客户端来做到这一点,因此我的 uri 域在每次调用后都会改变,所以我需要像 Spring Boot 中一样的 RestTemplate。
如何在 Micronaut 中实现同样的效果?
private static void getEmployees()
{
final String uri = "http://localhost:8080/springrestexample/employees.xml";
RestTemplate restTemplate = new RestTemplate();
String result = restTemplate.getForObject(uri, String.class);
System.out.println(result);
}
【问题讨论】: