KestrunResponse.WriteXmlResponse method
Writes an XML response with the specified input object, status code, and content type.
public void WriteXmlResponse(object? inputObject, int statusCode = 200, string? contentType = null,
string? rootElementName = null, bool compress = false)
| parameter | description |
|---|---|
| inputObject | The object to be converted to XML. |
| statusCode | The HTTP status code for the response. |
| contentType | The MIME type of the response content. |
| rootElementName | Optional custom XML root element name. Defaults to Response. |
| compress | If true, emits compact XML (no indentation); if false (default) output is human readable. |
See Also
- class KestrunResponse
- namespace Kestrun.Models