Springboot使用put、delete请求报错
SpringBoot给我们自动配置好了HiddenHttpMethodFilter,但是最近发现好像用不了,我用的是SpringBoot版本是2.2.2,默认配置被改成了false,也就是关闭了自动配置,不知道sprongboot什么鬼,坑!!!
There was an unexpected error (type=Method Not Allowed, status=405).
Request method 'POST' not supported
org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
要把springboot配置yml文件改成
spring:
mvc:
hiddenmethod:
filter:
enabled: true
参考 https://blog.csdn.net/u014471567/article/details/102866776