SpringBoot PUT请求


(1)配置HiddenHttpMethodFilter(SpringMVC需要配置,SpringBoot已经为我们自动配置了)

(2)在视图页面创建一个Post Form表单,在表单中创建一个input项,type="hidden" name="_method",value属性值为请求方式

 1 <!DOCTYPE html>
 2 <html lang="en" xmlns:th="http://www.thymeleaf.org">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>登陆</title>
 6 </head>
 7 <body>
 8     <form method="post" th:action="@{/user/login}">
 9         <input type="hidden" name="_method" value="put"/>
10         <input type="submit" value="登陆"/>
11     </form>
12 </body>
13 </html>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM