feign Request method 'POST' not supported
时间: 2023-08-27 12:07:19 浏览: 132
当使用Feign进行远程调用时,有时会遇到"Request method 'POST' not supported"的错误提示。这个错误表明Feign不支持该方法的POST请求。为了解决这个问题,可以尝试以下方法:
1. 在Feign接口的方法上加上@RequestParam注解,强制将该方法调用为GET请求。这样可以将POST请求转换为GET请求。
2. 如果出现POST请求的方法不支持GET请求的错误,可以在Feign接口的方法上加上@RequestBody注解,强制将该方法调用为POST请求。
这些方法可以解决Feign中"Request method 'POST' not supported"的错误,使远程调用能够正常进行。引用<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [避坑 | 调用feign远程get请求的接口却提示“Request method ‘POST‘ not supported”](https://blog.csdn.net/m0_58071091/article/details/123727009)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [spring cloud feign不支持@RequestBody+ RequestMethod.GET报错的解决方法](https://download.csdn.net/download/weixin_38748769/12764348)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文