gin对于重定向的请求,相当简单。调用上下文的Redirect方法:

    router.GET(
"/redict/google"
, func(c *gin.Context) {
        c.Redirect(http.StatusMovedPermanently, 
"https://google.com"
)
    })

results matching ""

    No results matching ""