Refactors binding module

This commit is contained in:
Manu Mtz-Almeida
2015-03-31 17:51:10 +02:00
parent 18880f9215
commit d4413b6e91
10 changed files with 367 additions and 299 deletions
+10
View File
@@ -13,6 +13,16 @@ import (
"github.com/gin-gonic/gin/binding"
)
const (
MIMEJSON = binding.MIMEJSON
MIMEHTML = binding.MIMEHTML
MIMEXML = binding.MIMEXML
MIMEXML2 = binding.MIMEXML2
MIMEPlain = binding.MIMEPlain
MIMEPOSTForm = binding.MIMEPOSTForm
MIMEMultipartPOSTForm = binding.MIMEMultipartPOSTForm
)
// DEPRECATED, use Bind() instead.
// Like ParseBody() but this method also writes a 400 error if the json is not valid.
func (c *Context) EnsureBody(item interface{}) bool {