Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
  2. r.ParseForm()
  3. log.Println(r.Form)
  4. }
  5.  
  6. curl -d '{"foo":"bar"}' http://localhost:3000
  7. prints: map[foo:[bar]]
  8.  
  9. curl -H "Content-Type: application/json" -d '{"foo":"bar"}' http://localhost:3000
  10. prints: map[]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement