ASP.Net Web API showing correctly in VS but giving HTTP500

前端 未结 7 878
离开以前
离开以前 2020-12-17 04:55

after a lot of help yesterday, I came up against a known error in asp.net4 beta - I upgraded to VS2012 RC Express (4.5), and now I\'m getting an internal server error, and I

相关标签:
7条回答
  • 2020-12-17 05:25

    Api Controller is based on Convention-Over-Configuration so you can try to solve in either one of the following ways:

    • Rename your method to "Get" so that it match the GET verb

    • Decorate your method with the HttpGet attribute: [HttpGet]

    • Go to the API's Route mapping in Global.asax and {action} after {controller}/ in order to call it by http://mydomain.com/myapi/api/bookings/GettblCustomerBookings()

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