因此,我在html中有此表單。它旨在向/subscribe頁(yè)面發(fā)出POST請(qǐng)求:<html> <form action="/subscribe" method="post"> First Name: <input type="text" name="first_name" placeholder="Willy"/><br/> Last Name: <input type="text" name="last_name" placeholder="Warmwood"/><br/> Email: <input type="email" name="email" placeholder="willy.warwood@gmail.com"/><br/> <input type="submit" value="Submit"/> </form></html>然后,我在golang中安裝了此路由器:http.HandleFunc("/subscribe/", SubscribeHandler)而在golang中的此處理程序:func SubscribeHandler(w http.ResponseWriter, r *http.Request) { log.Println(r.Method)}但是問(wèn)題是,它總是print GET。如何過(guò)帳表格,所以的價(jià)值r.Method是POST?
- 1 回答
- 0 關(guān)注
- 294 瀏覽
添加回答
舉報(bào)
0/150
提交
取消