XML
Content-Type: "text/xml"
Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
The Context.XML(v, ...opts)
is the method which sends XML responses to the client. It accepts the value and optional settings for rendering. The XML
options structure looks like this:
If
Indent
field is empty and the application runs without optimizations, theIndent
field will be automatically set to2 spaces
.
Render a Go struct as XML response:
Result
Result
References:
Last updated
Was this helpful?