Cookie binds the request cookie 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). NOTE: If your cookie is like key=val1,val2; they'll be bound as a slice if your map is map[string][]st
(out any)
| 270 | // Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode). |
| 271 | // NOTE: If your cookie is like key=val1,val2; they'll be bound as a slice if your map is map[string][]string. Else, it'll use last element of cookie. |
| 272 | func (b *Bind) Cookie(out any) error { |
| 273 | bind := binder.GetFromThePool[*binder.CookieBinding](&binder.CookieBinderPool) |
| 274 | bind.EnableSplitting = b.ctx.App().config.EnableSplittingOnParsers |
| 275 | |
| 276 | defer releasePooledBinder(&binder.CookieBinderPool, bind) |
| 277 | |
| 278 | if err := b.returnBindErr(bind.Bind(&b.ctx.RequestCtx().Request, out), BindSourceCookie); err != nil { |
| 279 | return err |
| 280 | } |
| 281 | |
| 282 | return b.validateStruct(out) |
| 283 | } |
| 284 | |
| 285 | // Query binds the query string into the struct, map[string]string and map[string][]string. |
| 286 | // Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode). |
nothing calls this directly
no test coverage detected