main.go 292 B

12345678910111213141516171819
  1. package main
  2. import (
  3. "fmt"
  4. "io/ioutil"
  5. "net/http"
  6. )
  7. func main() {
  8. http.HandleFunc("/test", func(w http.ResponseWriter, r *http.Request) {
  9. b, err := ioutil.ReadAll(r.Body)
  10. if err != nil {
  11. panic(err)
  12. }
  13. fmt.Println(string(b))
  14. })
  15. http.ListenAndServe("127.0.0.1:8899", nil)
  16. }