ASP.NET MVC 4 Web API fails to map path containing the string “con”?

前端 未结 1 982
遥遥无期
遥遥无期 2020-12-16 15:41

What is so wrong about the string \"con\"?

OK, my api route configuration is rather uninteresting:

config.Routes.MapHttpRoute(
    name: \"DefaultApi         


        
相关标签:
1条回答
  • 2020-12-16 15:56

    Certain keywords are not allowed in the URL and CON is one of them. See this. The workaround is to include the following under <system.web> in your Web.config.

    <httpRuntime relaxedUrlToFileSystemMapping="true" />
    
    0 讨论(0)
提交回复
热议问题