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