其他分享
首页 > 其他分享> > fegin调用异常feign.FeignException$MethodNotAllowed: [405] during [GET]

fegin调用异常feign.FeignException$MethodNotAllowed: [405] during [GET]

作者:互联网

fegin调用异常feign.FeignException$MethodNotAllowed: [405] during [GET]

问题:在这里插入图片描述
fegin调用异常feign.FeignException$MethodNotAllowed: [405] during [GET] 。原因是在feign接口层的接口方法不能正确的解析传入参数导致;
此时容易出现问题的地方有两个:第一个请求方式不一致,比如provider定义的为Get请求,而consumer采用的是post请求,则会出现异常。
第二个就是参数导致的,OpenFeign在构造请求时需要@RequestMapping/@RequestParam/@PathVariable/@RequestHeader等来构造http请求。添加@RequesrParam解决此问题。
在这里插入图片描述

标签:feign,fegin,GET,FeignException,405,during
来源: https://blog.csdn.net/weixin_44411398/article/details/113759917