The Constraint Entry 'httpMethod' on the Route Must Have a String Value

两盒软妹~` 提交于 2019-12-04 07:42:06

Make sure that you are using the proper type for your constraint:

constraints: new { httpMethod = new System.Web.Http.Routing.HttpMethodConstraint(HttpMethod.Get) }

I guess you were using System.Web.Routing.HttpMethodConstraint which is an entirely different class used for ASP.NET MVC routing and which has nothing to do with ASP.NET Web API routing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!