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)
| 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). |
| 241 | func (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). |