We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0fbebe commit 771f0b8Copy full SHA for 771f0b8
zh/08.3.md
@@ -89,17 +89,16 @@ Go没有为REST提供直接支持,但是因为RESTful是基于HTTP协议实现
89
}
90
91
func adduser(w http.ResponseWriter, r *http.Request) {
92
- params := r.URL.Query()
93
- uid := params.Get(":uid")
+ uid := r.FormValue("uid")
94
fmt.Fprint(w, "you are add user %s", uid)
95
96
97
func main() {
98
mux := routes.New()
99
mux.Get("/user/:uid", getuser)
100
- mux.Post("/user/:uid", modifyuser)
+ mux.Post("/user/", adduser)
101
mux.Del("/user/:uid", deleteuser)
102
- mux.Put("/user/", adduser)
+ mux.Put("/user/:uid", modifyuser)
103
http.Handle("/", mux)
104
http.ListenAndServe(":8088", nil)
105
0 commit comments