Multiple actions were found that match the request in Web Api

今天去访问写好的API时,显示一个异常:Multiple action were found that match the request in Web Api。

Multiple actions were found that match the request in Web Api


打开原始API接口文件查看:

Multiple actions were found that match the request in Web Api

 

再去查看API配置文件:

Multiple actions were found that match the request in Web Api

 

默认API路由,只是简单设为api/{controller},现同Insus.NET以上所写的API文件中,将有2种相同的HttpPost的请求接口,这样导至配置文件不知道请求的是哪一个。所以得稍修改一下这个配置文件。

改为:

Multiple actions were found that match the request in Web Api

 

重新build程序,运行,一切正常。

上一篇:[LeetCode] 158. Read N Characters Given Read4 II - Call multiple times


下一篇:D - Multiple of 2019