因此,我在html中有此表单。它旨在向/subscribe页面发出POST请求:<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)}但是问题是,它总是print GET。如何过帐表格,所以的价值r.Method是POST?
1 回答
- 1 回答
- 0 关注
- 267 浏览
添加回答
举报
0/150
提交
取消