Using a simple HTTP server in Go (1.4), the request form is empty if content-type is set to "application/json". Is this intended?
The simple http handler:
func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
log.Println(r.Form)
}
For this curl request, the handler prints the correct form values:
curl -d '{"foo":"bar"}' http://localhost:3000
prints: map[foo:[bar]]
For this curl request, the handler does not print the form values:
curl -H "Content-Type: application/json" -d '{"foo":"bar"}' http://localhost:3000
prints: map[]