“请求的资源不支持http方法'POST'。-邮递员

时间:2018-10-05 06:20:31

标签: asp.net-web-api postman

我有一个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'."

enter image description here

我已经尝试过添加,只是在Postman中以不同的方式设置url,但仍然存在此问题:

http://localhost:59694/api/user - with Post, I've deleted the `ActionName attribute` from controller.

我已经检查过RouteConfig.cs,我已经知道了:

  routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

可以请教吗?

0 个答案:

没有答案