AFAIK you can't use HttpModules with a self hosted WebAPI server. I think what you need is a MessageHandler.
How do I register a custom IHttpModule with HttpServer
-
28-06-2022 - |
Вопрос
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?
Решение
Не связан с StackOverflow