Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No HTTP resource was found that matches the request URI

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

like image 852
Diego Vieira Avatar asked Dec 28 '12 01:12

Diego Vieira


1 Answers

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.

like image 108
Xenon Avatar answered Oct 20 '22 10:10

Xenon