Ajax Post: 405 Method Not Allowed

↘锁芯ラ 提交于 2019-12-03 06:09:35

Most likely your routing is not configured for the action to be invoked. Hence the request ends up in nowhere and ASP.NET Web API sends a blank-out message "method not allowed".

Can you please update the question with your routing?


UPDATE

As I thought! You are sending to http://localhost:65396/api/payment/charge while you need to send to http://localhost:65396/api/payment - assuming your controller is called PaymentController.

Note that route does not have action.

I had the same problem with my controller. The only thing which is different is the ending of the URL. Add "/" to "http://localhost:65396/api/payment/charge" at the end, that helped me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!