I got something running with the Goji framework:
package main
import (
\"fmt\"
\"net/http\"
\"github.com/zenazn/goji\"
\"gi
In order to read html form values you have to first call r.ParseForm(). The you can get at the form values.
So this code:
func hello(c web.C, w http.ResponseWriter, r *http.Request){
name := r.PostFormValue("name")
fmt.Fprintf(w, "Hello, %s!", name)
}
Should be this:
func hello(c web.C, w http.ResponseWriter, r *http.Request){
//Call to ParseForm makes form fields available.
err := r.ParseForm()
if err != nil {
// Handle error here via logging and then return
}
name := r.PostFormValue("name")
fmt.Fprintf(w, "Hello, %s!", name)
}
Edit: I should note that this was a point that tripped me up when learning the net/http package