MCPcopy Create free account
hub / github.com/kataras/iris / PostValueInt

Method PostValueInt

context/context.go:2060–2067  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2058//
2059// See ErrEmptyForm, ErrNotFound and ErrEmptyFormField respectfully.
2060func (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.

Callers 1

PostValueIntDefaultMethod · 0.95

Calls 2

PostValueStringMethod · 0.95
strParseIntFunction · 0.85

Tested by

no test coverage detected