我尝试在过滤器中添加标头:
Response.AppendHeader("Content-Encoding", "gzip");
但它不会出现在浏览器中,不会出现在Chrome中,也不会出现在Firefox中:
这就是我如何回归json:
[HttpPost]
public virtual ActionResult GetMetaData()
{
var result = new BL().GetMetaData();
string response = JsonConvert.SerializeObject(result, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
return Content(response, "application/json");
}