Pregunta

I am using the HttpServer class to test my web api. In my application, I have a custom IHttpModule that handles some URL rewriting. I need this module to process the requests for my web api as well. Here is my code that I use to create the HttpServer object.

var config = new HttpSelfHostConfiguration(ServerUrl);
RouteConfig.RegisterRoutes(config.Routes);
FilterConfig.RegisterWebApiFilters(config.Filters);
var httpServer = new HttpServer(config);

Can someone tell me the obvious thing I am missing that I need to do to register my module with the server?

¿Fue útil?

Solución

AFAIK you can't use HttpModules with a self hosted WebAPI server. I think what you need is a MessageHandler.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top