Form binds the form 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). If Content-Type is "application/x-www-form-urlencoded" or "multipart/form-data", it will bind the form values. Multipart f
(out any)
| 346 | // If Content-Type is "application/x-www-form-urlencoded" or "multipart/form-data", it will bind the form values. |
| 347 | // Multipart file fields are supported using *multipart.FileHeader, []*multipart.FileHeader, or *[]*multipart.FileHeader. |
| 348 | func (b *Bind) Form(out any) error { |
| 349 | bind := binder.GetFromThePool[*binder.FormBinding](&binder.FormBinderPool) |
| 350 | bind.EnableSplitting = b.ctx.App().config.EnableSplittingOnParsers |
| 351 | bind.MaxBodySize = b.ctx.App().config.BodyLimit |
| 352 | |
| 353 | defer releasePooledBinder(&binder.FormBinderPool, bind) |
| 354 | |
| 355 | if err := b.returnBindErr(bind.Bind(&b.ctx.RequestCtx().Request, out), BindSourceBody); err != nil { |
| 356 | return err |
| 357 | } |
| 358 | |
| 359 | return b.validateStruct(out) |
| 360 | } |
| 361 | |
| 362 | // URI binds the route parameters into the struct, map[string]string and map[string][]string. |
| 363 | // Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode). |