package main import ( "log" "net/http" ) func Vote(w http.ResponseWriter, r *http.Request) { if r.Method == "POST" { r.ParseForm() log.Printf("Handling new vote from %s: %s [%s]\n", r.Header.Get("X-Forwarded-For"), r.URL.Path, r.UserAgent()) for k, v := range r.PostForm { log.Println(k + ":", v) } http.ServeFile(w, r, "thanks.html") } else { http.NotFound(w, r) } }