springboot的Request method ‘POST’ not supported错误和Request method ‘DELETE’ not supported
在使用springboot的post提交的时候,有时候会显示出Request method ‘POST’ not supported错误和Request method ‘DELETE’ not supported
错误
这是因为在新版的springboot中HiddenHttpMethodFilter过滤器是处于false的默认状态,
需要我们自行更改配置,我们可以在默认配置application.properties文件里面进行更改。
添加以下这句话
spring.mvc.hiddenmethod.filter.enabled=true
这样子就可以把HiddenHttpMethodFilter过滤器开启
这样子就可以就解决了Request method ‘POST’ not supported这个错误或者是Request method ‘DELETE’ not supported错误