WebApi Filter 中断返回字符串信息

 

public override void OnActionExecuting(HttpActionContext ActionContext)
{

string json = "{\"result\":\"true\"}";
ActionContext.Response = new HttpResponseMessage { Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") };

}

posted on 2015-12-22 17:23  习惯简单  阅读(473)  评论(0编辑  收藏  举报

导航