Browse Source

update bind with header

ls 1 year ago
parent
commit
f2db23c6ce
1 changed files with 6 additions and 0 deletions
  1. 6 0
      binding/binding.go

+ 6 - 0
binding/binding.go

@@ -2,6 +2,7 @@
 // Use of this source code is governed by a MIT style
 // license that can be found in the LICENSE file.
 
+//go:build !nomsgpack
 // +build !nomsgpack
 
 package binding
@@ -89,6 +90,11 @@ func Bind(req *http.Request, obj interface{}) error {
 	return MustBindWith(req, obj, b)
 }
 
+// BindHeader bind with header
+func BindHeader(req *http.Request, obj interface{}) error {
+	return Header.Bind(req, obj)
+}
+
 // MustBindWith binds the passed struct pointer using the specified binding engine.
 // It will abort the request with HTTP 400 if any error occurs.
 // See the binding package.