Decode request.Body

#7 · open · 0 comments

View on GitHub ↗

LeoCBS

Decode http.Request.Body into a interface{} to simplify handler implementation Decode code: ``` err := json.NewDecoder(r.Body).Decode(&p) if err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } ```

Comments