Springboot使用put、delete请求报错405

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


版权声明:本文为lizhe0327原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。