我有一个Api
控制器:UserController
在此控制器内,我有此方法:
[System.Web.Http.HttpPost]
[ActionName("SignUp")]
public async Task<HttpResponseMessage> Post([FromBody]FormDataCollection formData)
{
HttpResponseMessage MyHttpResponseMessage = new HttpResponseMessage(HttpStatusCode.InternalServerError); ....
.....
}
我想在Postman中调试它,但我总是收到此错误:
"Message": "The requested resource does not support http method 'POST'."
我已经尝试过添加,只是在Postman中以不同的方式设置url
,但仍然存在此问题:
http://localhost:59694/api/user - with Post, I've deleted the `ActionName attribute` from controller.
我已经检查过RouteConfig.cs
,我已经知道了:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
可以请教吗?