【发布时间】:2014-03-06 07:01:02
【问题描述】:
我正忙于实现和身份验证过滤器:
public Task AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken)
{
var request = context.Request;
// Receive token from the client. Here is the example when token is in header:
var token = request.Headers.FirstOrDefault(x => x.Key == "Token").Value.ToString(); //["Token"];
如何获取名为 token 的标头?因为上面的代码不起作用。我猜这是因为它不是标准标题。
【问题讨论】:
标签: asp.net-mvc http asp.net-web-api httpcontext