PureJSON serializes the given struct as JSON into the response body. PureJSON, unlike JSON, does not replace special html characters with their unicode entities.
(code int, obj any)
| 1215 | // PureJSON serializes the given struct as JSON into the response body. |
| 1216 | // PureJSON, unlike JSON, does not replace special html characters with their unicode entities. |
| 1217 | func (c *Context) PureJSON(code int, obj any) { |
| 1218 | c.Render(code, render.PureJSON{Data: obj}) |
| 1219 | } |
| 1220 | |
| 1221 | // XML serializes the given struct as XML into the response body. |
| 1222 | // It also sets the Content-Type as "application/xml". |