feat(context): add BindQuery func (#1029)
* feat(context): add BindQuery func, only parse/bind the query string params. * docs(readme): add BindQuery section. * docs(readme): fix import. * docs(readme): separate import
This commit is contained in:
committed by
Javier Provecho Fernandez
parent
74221b8a35
commit
c19aa0598b
@ -467,6 +467,11 @@ func (c *Context) BindJSON(obj interface{}) error {
|
||||
return c.MustBindWith(obj, binding.JSON)
|
||||
}
|
||||
|
||||
// BindQuery is a shortcut for c.MustBindWith(obj, binding.Query)
|
||||
func (c *Context) BindQuery(obj interface{}) error {
|
||||
return c.MustBindWith(obj, binding.Query)
|
||||
}
|
||||
|
||||
// MustBindWith binds the passed struct pointer using the specified binding
|
||||
// engine. It will abort the request with HTTP 400 if any error ocurrs.
|
||||
// See the binding package.
|
||||
|
Reference in New Issue
Block a user