I'm trying to display the returned data as xml, but it returns in plain text. I've this code:
context.Response.AddHeader("Content-Type", "text/xml");
context.Response.Write("<pre>" + HttpUtility.HtmlEncode(writer) + "</pre>");
I'am using this :
using (XmlTextWriter writer = new XmlTextWriter(context.Response.OutputStream, System.Text.Encoding.UTF8))
{
... write the xml
}
... and create the XML.
This is how I send: context.Response.Write("<pre>" + HttpUtility.HtmlEncode(writer) + "</pre>");
How can i return XML in RAW with tags and all?