From 9056137107eea56cba5bd5f3e84e67a62d6079cc Mon Sep 17 00:00:00 2001 From: Miles Date: Sat, 23 May 2020 22:55:26 +0800 Subject: [PATCH] Add a redirect sample for POST method Refer to issue https://github.com/gin-gonic/gin/issues/444 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cc23fc2..7f33e168 100644 --- a/README.md +++ b/README.md @@ -1393,7 +1393,12 @@ r.GET("/test", func(c *gin.Context) { c.Redirect(http.StatusMovedPermanently, "http://www.google.com/") }) ``` - +Issuing a HTTP redirect from POST. Refer to issue: [#444](https://github.com/gin-gonic/gin/issues/444) +```go +r.POST("/test", func(c *gin.Context) { + c.Redirect(http.StatusFound, "/foo") +}) +``` Issuing a Router redirect, use `HandleContext` like below.