From 5971f265750f8878b41fdee641bacb7d3f7e1f73 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 27 May 2020 21:03:08 +0800 Subject: [PATCH] chore: Add a redirect sample for POST method See: https://github.com/gin-gonic/gin/pull/2389 --- content/en/docs/examples/redirects.md | 7 +++++++ content/ja/docs/examples/redirects.md | 7 +++++++ content/ko-kr/docs/examples/redirects.md | 7 +++++++ content/zh-cn/docs/examples/redirects.md | 7 +++++++ content/zh-tw/docs/examples/redirects.md | 7 +++++++ 5 files changed, 35 insertions(+) diff --git a/content/en/docs/examples/redirects.md b/content/en/docs/examples/redirects.md index 0afc2235b..f7d823eca 100644 --- a/content/en/docs/examples/redirects.md +++ b/content/en/docs/examples/redirects.md @@ -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. diff --git a/content/ja/docs/examples/redirects.md b/content/ja/docs/examples/redirects.md index 6766393c0..d1a78bf53 100644 --- a/content/ja/docs/examples/redirects.md +++ b/content/ja/docs/examples/redirects.md @@ -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` メソッドを使ってください。 diff --git a/content/ko-kr/docs/examples/redirects.md b/content/ko-kr/docs/examples/redirects.md index d3c4fba68..7953fb2fd 100644 --- a/content/ko-kr/docs/examples/redirects.md +++ b/content/ko-kr/docs/examples/redirects.md @@ -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`를 사용하세요. diff --git a/content/zh-cn/docs/examples/redirects.md b/content/zh-cn/docs/examples/redirects.md index 88b63a603..0fed66d33 100644 --- a/content/zh-cn/docs/examples/redirects.md +++ b/content/zh-cn/docs/examples/redirects.md @@ -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`: diff --git a/content/zh-tw/docs/examples/redirects.md b/content/zh-tw/docs/examples/redirects.md index 0afc2235b..f7d823eca 100644 --- a/content/zh-tw/docs/examples/redirects.md +++ b/content/zh-tw/docs/examples/redirects.md @@ -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.