外部重定向
r.GET("/301_test", func(c *gin.Context) {c.Redirect(301, "http://www.baidu.com")})
内部重定向
r.GET("/test_json", func(c *gin.Context) {c.Request.URL.Path = "/test.json"r.HandleContext(c)})r.GET("/test.json", func(c *gin.Context) {c.Header("Content-Type", "application/json")c.JSON(200, gin.H{"msg": "ok",})})
