HTML renders the HTTP template specified by its file name. It also updates the HTTP code and sets the Content-Type as "text/html". See http://golang.org/doc/articles/wiki/
(code int, name string, obj any)
| 1169 | // It also updates the HTTP code and sets the Content-Type as "text/html". |
| 1170 | // See http://golang.org/doc/articles/wiki/ |
| 1171 | func (c *Context) HTML(code int, name string, obj any) { |
| 1172 | instance := c.engine.HTMLRender.Instance(name, obj) |
| 1173 | c.Render(code, instance) |
| 1174 | } |
| 1175 | |
| 1176 | // IndentedJSON serializes the given struct as pretty JSON (indented + endlines) into the response body. |
| 1177 | // It also sets the Content-Type as "application/json". |