【发布时间】:2014-03-27 20:54:52
【问题描述】:
您好,我正在使用 wep api 2 创建此路由。我有
在我的 WebConfigApi 中定义
config.MapHttpAttributeRoutes();
// In Globa.asax
GlobalConfiguration.Configure(WebApiConfig.Register);
我的方法被装饰成
[Route("api/pO")]
[AcceptVerbs("Getpo")]
[HttpGet]
public IEnumerable<pOver> Getpo()
{
------
}
当我使用
运行它时 ../api/pO/Getpo
我不断收到错误
"<Error><Message>No HTTP resource was found that matches the request URI 'http://localhost:60482/api/pO/Getp0'.</Message><MessageDetail>No action was found on the controller 'prO' that matches the request.</MessageDetail></Error>"
请告诉我如何正确装饰它以运行它。 谢谢
【问题讨论】:
标签: c# asp.net asp.net-web-api asp.net-web-api2