How do you debug MVC 4 API routes?

前端 未结 5 1868
孤独总比滥情好
孤独总比滥情好 2020-12-07 23:57

I have a WP7 game that uses RESTsharp to communicate with my MVC4 RESTful server, but I often have issues making requests that work and therefore I want to debug where it fa

5条回答
  •  臣服心动
    2020-12-08 00:38

    Is GameController deriving from ApiController ? Are you using WebApi ?

    If not then i think the "/api/" is reserved for new WebApi feature. Try changing your routing and controller name to "gameapi"

    If however you are using WebApi.

    Then remove api from yor BaseUrl

      client = new RestClient
      {
          CookieContainer = new CookieContainer(),
          BaseUrl = "http://localhost:21688/",
      };
    

提交回复
热议问题