文章目录[隐藏]
@RequestMapping(value = "/dream/{id}", method = RequestMethod.GET)
不能写成@GetMapping("/dream/{id}")
。
@RequestMapping(value = "/simple/{id}", method = RequestMethod.GET)
如果想要请求microservice-provider-user 服务,并且参数有多个例如:http://microservice-provider-user/query-by?id=1&username=张三
@FeignClient("microservice-provider-user")public
interface
UserFeignClient {@RequestMapping(value = "/query-by", method = RequestMethod.GET)public
User queryBy(User user);...}
直接使用复杂对象:
该请求不会成功,只要参数是复杂对象,即使指定了是GET方法,feign依然会以POST方法进行发送请求