FormValues returns the form field values as `url.Values`.
()
| 410 | |
| 411 | // FormValues returns the form field values as `url.Values`. |
| 412 | func (c *Context) FormValues() (url.Values, error) { |
| 413 | if strings.HasPrefix(c.request.Header.Get(HeaderContentType), MIMEMultipartForm) { |
| 414 | if err := c.request.ParseMultipartForm(c.formParseMaxMemory); err != nil { |
| 415 | return nil, err |
| 416 | } |
| 417 | } else { |
| 418 | if err := c.request.ParseForm(); err != nil { |
| 419 | return nil, err |
| 420 | } |
| 421 | } |
| 422 | return c.request.Form, nil |
| 423 | } |
| 424 | |
| 425 | // FormFile returns the multipart form file for the provided name. |
| 426 | func (c *Context) FormFile(name string) (*multipart.FileHeader, error) { |