Using routing, URL redirection, and URL rewriting

When building applications, routing is used for mapping incoming requests to route handlers (URL matching) and for generating URLs for the responses (URL generation).

The routing capabilities of ASP.NET Core 2.0 combine and unify the routing capabilities of MVC and Web API that have existed before. They have been rebuilt from the ground up to create a common routing framework with all of the various features in a single place, available to all types of ASP.NET Core 2.0 projects.

Let's look at how routing works internally to better understand how it can be useful in your applications and how to apply it to our Tic-Tac-Toe example.

For each received request, a matching route is retrieved, based ...

Get Learning ASP.NET Core 2.0 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.