asp.net-web-api - “请求的资源不支持 http 方法 'POST'。- 邮递员
问题描述
我有一个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'."
我试图添加只是为了url
在 Postman 中以不同的方式设置,但仍然存在这个问题:
http://localhost:59694/api/user - with Post, I've deleted the `ActionName attribute` from controller.
我检查了RouteConfig.cs
,我有这个:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
你能给些建议么?
解决方案
推荐阅读
- android - 改变方向时如何保持活动和后台服务之间的连接
- python - 当我使用 PyQt5 在 VScode 中运行我的应用程序时,图像、图标等不显示/加载。我能做些什么?
- anylogic - 在选择输出元素之前持有代理以避免默认端口
- javascript - MUI-DATATABLES onDownload 函数给出未定义
- tfs - TFSFieldMapping 访问被拒绝
- android - Facebook Android sdk 错误 - 使用反斜杠生成 postRequest 'extinfo' json 数组
- c# - 如何通过碰撞将物体围绕球体旋转 360 度?
- c# - 在 c# 中使用 Sophos Labs Intelix 扫描上传的文件
- r - 从 chrome 下载数据的代码问题
- swift - ARFaceAnchor 如何确定顶点索引?