func DecodeJSON(r io.Reader, v interface{}) error {
	defer io.Copy(ioutil.Discard, r)  
	return json.NewDecoder(r).Decode(v)
}
DecodeJSON decodes a given reader into an interface using the json decoder.
package render
import (
	"encoding/json"
	"encoding/xml"
	"errors"
	"io"
	"io/ioutil"
	"net/http"
	"github.com/ajg/form"
)
var Decode = DefaultDecoder
func DefaultDecoder(r *http.Request, v interface{}) error {
	var err error
	switch GetRequestContentType(r) {
	case ContentTypeJSON:
		err = DecodeJSON(r.Body, v)
	case ContentTypeXML:
		err = DecodeXML(r.Body, v)
	case ContentTypeForm:
		err = DecodeForm(r.Body, v)
	default:
		err = errors.New("render: unable to automatically decode the request content type")
	}
	return err
}