MCPcopy
hub / github.com/gin-gonic/gin / Redirect

Method Redirect

context.go:1253–1259  ·  view source on GitHub ↗

Redirect returns an HTTP redirect to the specific location.

(code int, location string)

Source from the content-addressed store, hash-verified

1251
1252// Redirect returns an HTTP redirect to the specific location.
1253func (c *Context) Redirect(code int, location string) {
1254 c.Render(-1, render.Redirect{
1255 Code: code,
1256 Location: location,
1257 Request: c.Request,
1258 })
1259}
1260
1261// Data writes some data into the body stream and updates the HTTP code.
1262func (c *Context) Data(code int, contentType string, data []byte) {

Calls 1

RenderMethod · 0.95