Skip to content

Commit

Permalink
chore: Add a redirect sample for POST method
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy committed May 27, 2020
1 parent 7e8c3a0 commit 5971f26
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
7 changes: 7 additions & 0 deletions content/en/docs/examples/redirects.md
Expand Up @@ -11,6 +11,13 @@ 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
7 changes: 7 additions & 0 deletions content/ja/docs/examples/redirects.md
Expand Up @@ -11,6 +11,13 @@ 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")
})
```

Router でリダイレクトするには、下記のように `HandleContext` メソッドを使ってください。

Expand Down
7 changes: 7 additions & 0 deletions content/ko-kr/docs/examples/redirects.md
Expand Up @@ -11,6 +11,13 @@ 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")
})
```

라우터 리다이렉트를 실행하려면, 아래와 같이 `HandleContext`를 사용하세요.

Expand Down
7 changes: 7 additions & 0 deletions content/zh-cn/docs/examples/redirects.md
Expand Up @@ -11,6 +11,13 @@ 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")
})
```

路由重定向,使用 `HandleContext`

Expand Down
7 changes: 7 additions & 0 deletions content/zh-tw/docs/examples/redirects.md
Expand Up @@ -11,6 +11,13 @@ 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 5971f26

Please sign in to comment.