企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## 路由 ### GET / POST / DELETE ``` router.GET("/someGet", getting) router.Any("/someGet", getting) router.POST("/somePost", posting) router.PUT("/somePut", putting) router.DELETE("/someDelete", deleting) router.PATCH("/somePatch", patching) router.HEAD("/someHead", head) router.OPTIONS("/someOptions", options) ``` ### Group 路由 ``` v1 := router.Group("/v1") { v1.GET("/login", loginEndpoint) v1.POST("/submit", submitEndpoint) v1.POST("/read", readEndpoint) } ``` ### 嵌套 group 路由 ``` v1 := router.Group("/v1") { v1.GET("/login", loginEndpoint) user := v1.Group("/user") { user.GET("/get", demo) } } ```