public static ContentResult returnJson(object obj) { var content = new ContentResult() { Content = JsonConvert.SerializeObject(obj, Formatting.Indented), ContentType = "application/json" }; return content; }
如:{"a":1,"b":2}
{
"a": 1,
"b": 2
}