MCPcopy
hub / github.com/gofiber/fiber / Header

Method Header

bind.go:241–252  ·  view source on GitHub ↗

Header binds the request header strings into the struct, map[string]string and map[string][]string. Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).

(out any)

Source from the content-addressed store, hash-verified

239// Header binds the request header strings into the struct, map[string]string and map[string][]string.
240// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).
241func (b *Bind) Header(out any) error {
242 bind := binder.GetFromThePool[*binder.HeaderBinding](&binder.HeaderBinderPool)
243 bind.EnableSplitting = b.ctx.App().config.EnableSplittingOnParsers
244
245 defer releasePooledBinder(&binder.HeaderBinderPool, bind)
246
247 if err := b.returnBindErr(bind.Bind(b.ctx.Request(), out), BindSourceHeader); err != nil {
248 return err
249 }
250
251 return b.validateStruct(out)
252}
253
254// RespHeader binds the response header strings into the struct, map[string]string and map[string][]string.
255// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).

Calls 6

returnBindErrMethod · 0.95
validateStructMethod · 0.95
releasePooledBinderFunction · 0.85
AppMethod · 0.65
BindMethod · 0.65
RequestMethod · 0.65