// Unmarshal http.Request.Body into a target struct, closes Body.
Unmarshal http.Request.Body into a target struct, closes Body.
// Unmarshal http . Request . Body into a target struct closes Body .
func JsonBody(r *http.Request, target interface{}) error {
	defer r.Body.Close()
	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return err
	}
	return json.Unmarshal(body, target)
}
func JsonBody ( r * http . Request , target interface { } ) error { defer r . Body . Close ( ) body , err := ioutil . ReadAll ( r . Body ) if err != nil { return err } return json . Unmarshal ( body , target ) }
Unmarshal http.Request.Body into a target struct, closes Body.
Unmarshal http . Request . Body into a target struct closes Body .