Redirect returns an HTTP redirect to the specific location.
(code int, location string)
| 1251 | |
| 1252 | // Redirect returns an HTTP redirect to the specific location. |
| 1253 | func (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. |
| 1262 | func (c *Context) Data(code int, contentType string, data []byte) { |