美文网首页
Golang通过http.Request.Method获取htt

Golang通过http.Request.Method获取htt

作者: 懒人程序猿 | 来源:发表于2020-04-29 16:03 被阅读0次

    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...

    相关文章

      网友评论

          本文标题:Golang通过http.Request.Method获取htt

          本文链接:https://www.haomeiwen.com/subject/jxhnwhtx.html