What is a middleware?

A middleware is a logical component that sits on the path of a request-response pipeline and is invoked for every request to execute a particular responsibility / functionality on that request. It has access to the HttpContext of the current request and so can be able to validate or reject an incoming request for some condition.

In ASP.NET Core, all the components of the framework such as controllers, authorizers and loggers are internally executed as middlewares.

Developers can also define and include own logical components to be executed to validate or emphasize on an incoming request by registering these as middlewares.

ASP.NET Core Posted Apr 06, 2020

You can now show your support. 😊

We use cookies to provide you with a great user experience, analyze traffic and serve targeted promotions.   Learn More   Accept