go获取http请求的method类型
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(r.Method + "\n"))
})
http.ListenAndServe("127.0.0.1:9090", nil)
GET、POST、PUT、DELETE...
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(r.Method + "\n"))
})
http.ListenAndServe("127.0.0.1:9090", nil)
GET、POST、PUT、DELETE...
本文标题:Golang通过http.Request.Method获取htt
本文链接:https://www.haomeiwen.com/subject/jxhnwhtx.html
网友评论