解决IE浏览器把application/json响应视为文件并尝试下载

下面我的解决方案是针对.net MVC的,其他的解决方案也类似,就是把响应的mimeType换成IE浏览器已经拥有的。如application/json换成text/plain

         #region 退出登录
public ActionResult Logout()
{
ResponseModel response = new ResponseModel();
try
{
_authenticationService.SignOut();
response.StatusCode = ;
response.Message = "退出登录";
}
catch (Exception e)
{
response.StatusCode = ;
response.Message = e.Message;
}
return Json(response, "text/plain", Encoding.UTF8, JsonRequestBehavior.AllowGet);
}
#endregion
上一篇:62. 63. Unique Paths 64. Minimum Path Sum


下一篇:iOS 学习笔记 十 (2015.04.03)xcode第三方插件