mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-18 14:52:18 +08:00
Add a redirect sample for POST method
Refer to issue https://github.com/gin-gonic/gin/issues/444
This commit is contained in:
parent
2773ce6e60
commit
9056137107
@ -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.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user