以下是WebAPI操作。在谷歌搜索关于下面的错误: -如何解决 - 请求的资源不支持http方法'POST'
The requested resource does not support http method 'POST'
我得到了相应的更新我的API链接&数量,但仍然我得到同样的错误。
- Web api not supporting POST method
ASP.NET Web Api: The requested resource does not support http method 'GET'
[AcceptVerbs("POST")] [HttpPost] [Route("rename/{userId}/{type}/{title}/")] public IHttpActionResult Rename([FromBody] int userId, [FromBody] string type, [FromBody] string title) { //my api stuff }
但仍然可以通过邮递员调用以上时抛出的错误。
如何摆脱这种错误的?
也可以解决这个问题,而不使用方法参数列表中的[FromBody]
属性?
任何帮助/建议高度赞赏。 谢谢。
显然,还有另一个叫做“重命名”的动作。和[路由(“重命名/ {userId}/{type}/{title} /”)]与您的请求url不匹配。 – levent
@levent,已勾选。没有什么这样的 –