Skip to content

Commit

Permalink
Add a redirect sample for POST method (#2389)
Browse files Browse the repository at this point in the history
* Add a redirect sample for POST method

Refer to issue #444

* put an empty line before 1396

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
MilesLin and appleboy committed May 24, 2020
1 parent 9221381 commit 5f261fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -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.

Expand Down

0 comments on commit 5f261fa

Please sign in to comment.