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

Method Query

context.go:525–528  ·  view source on GitHub ↗

Query returns the keyed url query value if it exists, otherwise it returns an empty string `("")`. It is shortcut for `c.Request.URL.Query().Get(key)` GET /path?id=1234&name=Manu&value= c.Query("id") == "1234" c.Query("name") == "Manu" c.Query("value") == "" c.Query("wtf")

(key string)

Source from the content-addressed store, hash-verified

523// c.Query("value") == ""
524// c.Query("wtf") == ""
525func (c *Context) Query(key string) (value string) {
526 value, _ = c.GetQuery(key)
527 return
528}
529
530// DefaultQuery returns the keyed url query value if it exists,
531// otherwise it returns the specified defaultValue string.

Callers 7

TestContextQueryFunction · 0.80
initQueryCacheMethod · 0.80
BindMethod · 0.80

Calls 1

GetQueryMethod · 0.95

Tested by 5

TestContextQueryFunction · 0.64