Tags "asp.net-web-api-routing" Result

ASP.NET Web API - Routing

I am using Web API to expose a bunch of services. I am having issue with some routes and need some help. I have the default route defined: config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new {id = RouteParameter.Optional} ); With this route I can

it1352 1 2019-05-08

RoutePrefix vs Route

I understand that RoutePrefix doesn't add a route to the routing table by itself. On your actions you need to have a Route attribute declared. I am having a hard time finding an authoritative blog/msdn page/ something that states why by defalut RoutePrefix doesn't add a route to the routing table. Does anyone have an authoritative post that does co

it1352 1 2020-09-12

ASP.NET Web Api Routing Customization

I have WebApi controllers that end with the "Api" suffix in their names (For ex: StudentsApiController, InstructorsApiController). I do this to easily differentiate my MVC controllers from WebApi controllers. I want my WebApi routes to look similar to http://localhost:50009/api/students/5 and not http://localhost:50009/api/studentsapi/5. Current

it1352 1 2019-05-08

ASP.NET Web API not working on Azure

Why would Web API stop working on Azure Websites if it works on localhost. The error is Failed to load resource: the server responded with a status of 404 (Not Found) or The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. when pasting URL to api in browser. NOTE: I have never encountered this er

it1352 2 2020-09-10