PostValueInt returns the last parsed form data matches the given "name" key from POST, PATCH, or PUT body request parameters as signed number. See ErrEmptyForm, ErrNotFound and ErrEmptyFormField respectfully.
(name string)
| 2058 | // |
| 2059 | // See ErrEmptyForm, ErrNotFound and ErrEmptyFormField respectfully. |
| 2060 | func (ctx *Context) PostValueInt(name string) (int, error) { |
| 2061 | value, err := ctx.PostValueString(name) |
| 2062 | if err != nil { |
| 2063 | return 0, err |
| 2064 | } |
| 2065 | |
| 2066 | return strParseInt(value) |
| 2067 | } |
| 2068 | |
| 2069 | // PostValueIntDefault same as PostValueInt but if errored it returns |
| 2070 | // the given "def" default value. |
no test coverage detected