一个服务调用另一个服务使用feign,但是报错:feign.FeignException$MethodNotAllowed: [405] during [GET]
原来是其中一个方法是get方法,但是因为feign的@RequestBody,会自动把Get请求变成Post,导致前后调用不一致报错。
解决方法:在pom文件中加上
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
</dependency>
这个依赖,然后就成功解决啦!