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

Method Handle

routergroup.go:103–108  ·  view source on GitHub ↗

Handle registers a new request handle and middleware with the given path and method. The last handler should be the real handler, the other ones should be middleware that can and should be shared among different routes. See the example code in GitHub. For GET, POST, PUT, PATCH and DELETE requests t

(httpMethod, relativePath string, handlers ...HandlerFunc)

Source from the content-addressed store, hash-verified

101// frequently used, non-standardized or custom methods (e.g. for internal
102// communication with a proxy).
103func (group *RouterGroup) Handle(httpMethod, relativePath string, handlers ...HandlerFunc) IRoutes {
104 if matched := regEnLetter.MatchString(httpMethod); !matched {
105 panic("http method " + httpMethod + " is not valid")
106 }
107 return group.handle(httpMethod, relativePath, handlers)
108}
109
110// POST is a shortcut for router.Handle("POST", path, handlers).
111func (group *RouterGroup) POST(relativePath string, handlers ...HandlerFunc) IRoutes {

Callers

nothing calls this directly

Calls 1

handleMethod · 0.95

Tested by

no test coverage detected