The inner handler has not been assigned using WebApi Delegating handler The inner handler has not been assigned using WebApi Delegating handler asp.net asp.net

The inner handler has not been assigned using WebApi Delegating handler


Found the answer here and an example handler here.

You need to set the InnerHandler you want the request passed on to.

Simply add this to your constructor:

public class WebApiAuthenticationHandler : DelegatingHandler{    public WebApiAuthenticationHandler(HttpConfiguration httpConfiguration)    {        InnerHandler = new HttpControllerDispatcher(httpConfiguration);     }

And pass in a reference to GlobalConfiguration when creating a new instance:

routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional }, null, WebApiAuthenticationHandler(GlobalConfiguration.Configuration));


Sometimes you should check the RESTful Url you request if it really does exist in your controller. I have ever encountered this kind of exception which was caused by the wrong URL match. thanks.