以下是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,已勾選。沒有什麼這樣的 –