ASP.NET Web Api: The requested resource does not support http method 'GET'

后端 未结 11 707
傲寒
傲寒 2020-12-04 18:50

I\'ve got the following action on an ApiController:

public string Something()
{
    return \"value\";
}

And I\'ve configured my routes as f

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 19:20

    If you have not configured any HttpMethod on your action in controller, it is assumed to be only HttpPost in RC. In Beta, it is assumed to support all methods - GET, PUT, POST and Delete. This is a small change from beta to RC. You could easily decore more than one httpmethod on your action with [AcceptVerbs("GET", "POST")].

提交回复
热议问题