使用Feign实现声明式REST调用_声明式 rest请求-CSDN博客

网站介绍:文章浏览阅读388次。使用Feign实现声明式REST调用之前示例中是使用RestTemplate实现REST API调用的,代码大致如下: public User findById(@PathVariable Long id){ return this.restTemplate.getForObject("http://microservice-provider-user/"+id,User.class); }由代码可知,我们是使用拼接字符串的方式构造URL的,该URL只有一个参数。然而在现实中_声明式 rest请求