ASP.NET MVC 3添加自定义标头例外

时间:2013-05-17 14:00:38

标签: asp.net asp.net-mvc-3 rest exception http-headers

我想添加回复标题“Access-Token”>名称“我的自定义值”>值

然后我收到了这个错误; system.platformnotsupportedexception你为什么这么想?

public abstract class BaseController:Controller 
{ 
    protected override void OnActionExecuting(ActionExecutingContext filterContext) 
    { 
       base.Response.AppendHeader("Access-Token", AccessTokenValidator.EncryptToken(LoggedInUserId)); 
       base.OnActionExecuting(filterContext); 
    }
}

0 个答案:

没有答案