Chapter 3. Handling requests with the middleware pipeline

This chapter covers

  • What middleware is
  • Serving static files using middleware
  • Adding functionality using middleware
  • Combining middleware to form a pipeline
  • Handling exceptions and errors with middleware

In the previous chapter, you had a whistle-stop tour of a complete ASP.NET Core application to see how the components come together to create a web application. In this chapter, we focus in on one small subsection: the middleware pipeline.

The middleware pipeline is one of the most important parts of configuration for defining how your application behaves and how it responds to requests. Understanding how to build and compose middleware is key to adding functionality to your applications. ...

Get ASP.NET Core in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.