【发布时间】:2013-12-28 17:25:19
【问题描述】:
我正在尝试通过以下方式实现请求限制:
Best way to implement request throttling in ASP.NET MVC?
我已将该代码提取到我的解决方案中,并使用以下属性装饰了一个 API 控制器端点:
[Route("api/dothis/{id}")]
[AcceptVerbs("POST")]
[Throttle(Name = "TestThrottle", Message = "You must wait {n} seconds before accessing this url again.", Seconds = 5)]
[Authorize]
public HttpResponseMessage DoThis(int id) {...}
这可以编译,但属性的代码没有被命中,并且限制不起作用。我没有收到任何错误。我错过了什么?
【问题讨论】:
标签: c# .net asp.net-web-api throttling