Add a redirect sample for POST method (#2389)
* Add a redirect sample for POST method Refer to issue https://github.com/gin-gonic/gin/issues/444 * put an empty line before 1396 Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
9221381443
commit
5f261fa752
@ -1394,6 +1394,12 @@ r.GET("/test", func(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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.
|
Issuing a Router redirect, use `HandleContext` like below.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user