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

Method URLParamDefault

context/context.go:1507–1513  ·  view source on GitHub ↗

URLParamDefault returns the get parameter from a request, if not found then "def" is returned.

(name string, def string)

Source from the content-addressed store, hash-verified

1505
1506// URLParamDefault returns the get parameter from a request, if not found then "def" is returned.
1507func (ctx *Context) URLParamDefault(name string, def string) string {
1508 if v := ctx.getQuery().Get(name); v != "" {
1509 return v
1510 }
1511
1512 return def
1513}
1514
1515// URLParam returns the get parameter from a request, if any.
1516func (ctx *Context) URLParam(name string) string {

Callers 5

URLParamMethod · 0.95
sendJSONFunction · 0.80
listUsersFunction · 0.80
getCurrentDataMethod · 0.80
postTopicProduceHandlerFunction · 0.80

Calls 2

getQueryMethod · 0.95
GetMethod · 0.65

Tested by

no test coverage detected