WebAPI and ODataController return 406 Not Acceptable

前端 未结 13 1148
余生分开走
余生分开走 2020-12-02 12:25

Before adding OData to my project, my routes where set up like this:

       config.Routes.MapHttpRoute(
            name: \"ApiById\",
            routeTempl         


        
相关标签:
13条回答
  • 2020-12-02 13:18

    The problem/solution in my case was even more stupid. I'd left test code in my action that returned a completely different model type, just a Dictionary, and not my proper EDM model type.

    Though I protest that the use of HTTP 406 Not Acceptable to communicate the error of my ways, is equally as stupid.

    0 讨论(0)
提交回复
热议问题