Skip to content

Commit

Permalink
Add a redirect sample for POST method
Browse files Browse the repository at this point in the history
Refer to issue gin-gonic#444
  • Loading branch information
MilesLin authored May 23, 2020
1 parent 2773ce6 commit 9056137
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 9056137

Please sign in to comment.