Example #1
0
        public static Response AsXml(this IResponseFormatter formatter, IXMLEntity entity)
        {
            var doc        = new XmlDocument();
            var firstChild = entity.Serialize(doc);

            doc.AppendChild(firstChild);

            return(FormatterExtensions.AsText(formatter, doc.OuterXml).WithContentType("text/xml"));
        }
 private Response ReturnResolvedVariable(VariableCollection variableCollection, dynamic parameters) => FormatterExtensions.AsText(Response, variableCollection.Get(parameters.variable));
Example #3
0
        private dynamic Echo(dynamic p)
        {
            var json = GetJson(p);

            return(FormatterExtensions.AsText(Response, json, "application/json"));
        }