Invalid HTTP method: PATCH
时间: 2023-09-02 16:10:42 浏览: 178
启动异常invalid constant type:15的解决方案
5星 · 资源好评率100%
回答: Invalid HTTP method: PATCH错误是由于java.net.HttpURLConnection.setRequestMethod不支持PATCH方法导致的。\[2\]解决这个问题的方法是使用HttpClient来发送请求,因为HttpClient支持PATCH方法。你可以添加以下依赖来解决这个问题:<dependency> <groupId>io.github.openfeign</groupId> <artifactId>feign-httpclient</artifactId> <version>${feign.version}</version> </dependency>。\[3\]这样就可以成功发送PATCH请求了。
#### 引用[.reference_title]
- *1* [解决RestTemplate使用PATCH方法报错问题](https://blog.csdn.net/w851685279/article/details/105031617)[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^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [Feign不支持PATCH请求的解决办法](https://blog.csdn.net/menggudaoke/article/details/77884674)[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^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文