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

Method Param

context.go:503–505  ·  view source on GitHub ↗

************************************/ ************ INPUT DATA ************/ ************************************/ Param returns the value of the URL param. It is a shortcut for c.Params.ByName(key) router.GET("/user/:id", func(c *gin.Context) { // a GET request to /user/john id := c.Para

(key string)

Source from the content-addressed store, hash-verified

501// id := c.Param("id") // id == "/john/"
502// })
503func (c *Context) Param(key string) string {
504 return c.Params.ByName(key)
505}
506
507// AddParam adds param to context and
508// replaces path param key with given value for e2e testing purposes

Calls 1

ByNameMethod · 0.80