XML serializes the given struct as XML into the response body. It also sets the Content-Type as "application/xml".
(code int, obj any)
| 1221 | // XML serializes the given struct as XML into the response body. |
| 1222 | // It also sets the Content-Type as "application/xml". |
| 1223 | func (c *Context) XML(code int, obj any) { |
| 1224 | c.Render(code, render.XML{Data: obj}) |
| 1225 | } |
| 1226 | |
| 1227 | // YAML serializes the given struct as YAML into the response body. |
| 1228 | func (c *Context) YAML(code int, obj any) { |