liveBook · Manning

Terminal middleware

Terminal middleware is a request-pipeline component that handles a request and returns a response without invoking subsequent components.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

Terminal middleware is a middleware component that stops further pipeline processing by generating and returning a response.

How it is used
Uses terminal middleware to generate specialized responses before endpoint routing handles the request.
How deep it goes
Explains short-circuiting, reverse response flow, and practical use cases, but stops short of implementing the three custom middleware approaches.
Examples
Uses authorization denial, Swagger, a welcome page, and a current-time plain-text response as concrete terminal responses.
What you can do after
Apply it via ASP.NET Core middleware to stop request processing and return a specialized response.

Read how ASP.NET Core in Action, 3e explains terminal middleware →

Building Web APIs with ASP.NET Core

Terminal middleware is middleware that can end HTTP request processing by returning a response without invoking later pipeline components.

How it is used
Explains how ASP.NET Core components end HTTP requests or forward them through the request pipeline.
How deep it goes
Defines conditional and unconditional termination, registration order, and the Run convention without implementing custom middleware.
Examples
Uses static-file responses, HTTPS redirects, and a Program.cs pipeline ending with app.Run.
What you can do after
Configure middleware order and recognize when a component terminates or forwards an HTTP request.

Read how Building Web APIs with ASP.NET Core explains terminal middleware →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.