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

Method XML

context.go:1223–1225  ·  view source on GitHub ↗

XML serializes the given struct as XML into the response body. It also sets the Content-Type as "application/xml".

(code int, obj any)

Source from the content-addressed store, hash-verified

1221// XML serializes the given struct as XML into the response body.
1222// It also sets the Content-Type as "application/xml".
1223func (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.
1228func (c *Context) YAML(code int, obj any) {

Callers 4

NegotiateMethod · 0.95
TestMiddlewareWriteFunction · 0.80
TestContextRenderXMLFunction · 0.80

Calls 1

RenderMethod · 0.95

Tested by 3

TestMiddlewareWriteFunction · 0.64
TestContextRenderXMLFunction · 0.64