ch2.4
This commit is contained in:
5
main.go
5
main.go
@@ -18,6 +18,11 @@ func snippetView(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func snippetCreate(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
w.Header().Set("Allow", http.MethodPost)
|
||||
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
w.Write([]byte("Create a new snippet"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user