Springboot使用put、delete请求报错405怎么解决
Springboot使用put、delete请求报错SpringBoot给我们自动配置好了HiddenHttpMethodFilter,但是最近发现好像用不了,我用的是SpringBoot版本是2.2.2,默认配置被改成了false,也就是关闭了自动配置,不知道sprongboot什么鬼,坑!!!Therewasanunexpectederror(type=MethodNotAllowed,status=405).Requestmethod'POST'notsupportedorg.spr
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
Springboot错误提示405状态
一、错误提示405状态截图

二、405状态的原因
SpringBoot的自动配置中默认是关闭spring.mvc.hiddenmethod.filter 过滤器的,所以当我们提交的数据是PUT、POST、DELETE方式时,我们使用的 _method 并不起作用。

spring.mvc.hiddenmethod.filter 自动配置:

三、解决方法
在 Spring Boot 的配置文件 application.properties 中将 hiddenmethod.filter 过滤器设置为启用即可。
spring.mvc.hiddenmethod.filter.enabled=true
Windows 10 是一款微软推出的经典操作系统,拥有硬件兼容性与多任务处理能力。它更偏向把系统状态查看和常用调节动作放在一起,适合需要持续观察和微调设备状态的场景。
极度公式是一款跨平台专业LaTeX公式识别编辑软件,支持OCR公式识别和多平台编辑。和使用说明,避免使用,享受完整功能与稳定支持。做扫描整理、文字提取和表格转换时,它能把识别后的处理步骤接得更顺,资料录入这类场景会省下不少时间。
















