Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- r.ParseForm()
- log.Println(r.Form)
- }
- curl -d '{"foo":"bar"}' http://localhost:3000
- prints: map[foo:[bar]]
- curl -H "Content-Type: application/json" -d '{"foo":"bar"}' http://localhost:3000
- prints: map[]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement