13 Using URL routing

This chapter covers

  • Understanding how routes can be used to match request URLs
  • Structuring URLs patterns to match requests
  • Matching requests using routes

The URL routing feature makes it easier to generate responses by consolidating the processing and matching of request URLs. In this chapter, I explain how the ASP.NET Core platform supports URL routing, show its use, and explain why it can be preferable to creating custom middleware components. Table 13.1 puts URL routing in context.

Note This chapter focuses on URL routing for the ASP.NET Core platform. See part 3 for details of how the higher-level parts of ASP.NET Core build on the features described in this chapter.

Table 13.1 Putting URL routing in context

Get Pro ASP.NET Core 7, Tenth Edition 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.