From df37e74fa1bbf8897ec2fa6ab347b27acdf5c444 Mon Sep 17 00:00:00 2001 From: Eason Lin Date: Tue, 1 Aug 2017 12:49:28 +0800 Subject: [PATCH] doc(context): more clearer bind doc when input is not valid (#1049) --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index 35ca8d2e..895ba7a1 100644 --- a/context.go +++ b/context.go @@ -456,7 +456,7 @@ func (c *Context) SaveUploadedFile(file *multipart.FileHeader, dst string) error // otherwise --> returns an error // It parses the request's body as JSON if Content-Type == "application/json" using JSON or XML as a JSON input. // It decodes the json payload into the struct specified as a pointer. -// Like ParseBody() but this method also writes a 400 error if the json is not valid. +// It will writes a 400 error and sets Content-Type header "text/plain" in the response if input is not valid. func (c *Context) Bind(obj interface{}) error { b := binding.Default(c.Request.Method, c.ContentType()) return c.MustBindWith(obj, b)