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

Function h

_examples/routing/main.go:130–145  ·  view source on GitHub ↗
(ctx iris.Context)

Source from the content-addressed store, hash-verified

128}
129
130func h(ctx iris.Context) {
131 method := ctx.Method() // the http method requested a server's resource.
132 subdomain := ctx.Subdomain() // the subdomain, if any.
133
134 // the request path (without scheme and host).
135 path := ctx.Path()
136 // how to get all parameters, if we don't know
137 // the names:
138 paramsLen := ctx.Params().Len()
139
140 ctx.Params().Visit(func(name string, value string) {
141 ctx.Writef("%s = %s\n", name, value)
142 })
143 ctx.Writef("Info\n\n")
144 ctx.Writef("Method: %s\nSubdomain: %s\nPath: %s\nParameters length: %d", method, subdomain, path, paramsLen)
145}
146
147func main() {
148 app := newApp()

Callers

nothing calls this directly

Calls 7

ParamsMethod · 0.80
WritefMethod · 0.80
MethodMethod · 0.65
SubdomainMethod · 0.65
PathMethod · 0.65
LenMethod · 0.65
VisitMethod · 0.65

Tested by

no test coverage detected