I just deployed my MVC app to a subdomain and I just can't get webapi to work.
Accessing locally: localhost:40052/api/apiEmpreendimento/GetObjects works just fine, but accessing the following online: http://subdomain.mysite.com/api/apiEmpreendimento/GetObjects
Gives me
{"Message":"No HTTP resource was found that matches the request URI 'http://subdomain.mysite.com/api/apiEmpreendimento/GetObjects'."}
App_Start/WebApiConfig.cs
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { action = "get", id = RouteParameter.Optional }
);
}
}
Any tip is much appreciated.
Thanks
I thought it's about new WepApi. MVC understands it like WebApi controller, Microsoft Reserved Api Controlller for their selves, I changed my Controller name With MyApiController and problem solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With