diff options
-rw-r--r-- | manager.go | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "os" "strings" @@ -83,20 +84,12 @@ func (hi *HTTPInput) httphandler(w http.ResponseWriter, r *http.Request) { fmt.Printf("Expected POST method was: %q\n", r.Method) return } - err := r.ParseForm() + all, err := ioutil.ReadAll(r.Body) if err != nil { - fmt.Printf("Error when parsing HTTP request form values: %q\n", err) + fmt.Printf("Error when reading HTTP request body: %q\n", err) return } - workdata := r.PostForm["work"] - fmt.Printf("Form %#v\n", r.Form) - if workdata == nil { - fmt.Printf("Work form field was empty.\n") - return - } - - fmt.Printf("Work form field was: %q\n", workdata) - hi.retchan <- &Work{data: []byte(workdata[0])} + hi.retchan <- &Work{data: all} } func (hi *HTTPInput) Start() chan *Work { |