MCPcopy
hub / github.com/gin-gonic/gin / DefaultPostForm

Method DefaultPostForm

context.go:609–614  ·  view source on GitHub ↗

DefaultPostForm returns the specified key from a POST urlencoded form or multipart form when it exists, otherwise it returns the specified defaultValue string. See: PostForm() and GetPostForm() for further information.

(key, defaultValue string)

Source from the content-addressed store, hash-verified

607// when it exists, otherwise it returns the specified defaultValue string.
608// See: PostForm() and GetPostForm() for further information.
609func (c *Context) DefaultPostForm(key, defaultValue string) string {
610 if value, ok := c.GetPostForm(key); ok {
611 return value
612 }
613 return defaultValue
614}
615
616// GetPostForm is like PostForm(key). It returns the specified key from a POST urlencoded
617// form or multipart form when it exists `(value, true)` (even when the value is an empty string),

Callers 2

Calls 1

GetPostFormMethod · 0.95

Tested by 2