In this recipe, we will learn how to transform an ASP.NET HTTP module in ASP.NET Core middleware.
Before anything, let's brush up on what an HTTP handler is. An HTTP module can add a treatment to an incoming request from the ASP.NET/IIS pipeline before it arrives at the handler, and/or add a treatment to the generated response. It can even transform or generate its own response.