mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-24 02:32:17 +08:00
307 is better than 301
The browser will cache 301
This commit is contained in:
parent
ae9f03e6e8
commit
e43ed325bc
@ -984,7 +984,7 @@ Issuing a HTTP redirect is easy:
|
||||
|
||||
```go
|
||||
r.GET("/test", func(c *gin.Context) {
|
||||
c.Redirect(http.StatusMovedPermanently, "http://www.google.com/")
|
||||
c.Redirect(http.StatusTemporaryRedirect, "http://www.google.com/")
|
||||
})
|
||||
```
|
||||
Both internal and external locations are supported.
|
||||
|
Loading…
x
Reference in New Issue
Block a user