CHAPTER 3

image

Routing

This chapter introduces the concepts behind ASP.NET Web API routing mechanisms. It deals with centralized routing and direct (attribute) routing, which was introduced in version 2 of the framework.

You will learn how to do the following:

  • Define routes using both routing engines (Recipes 3-1 and 3-2)
  • Use default and optional route values, and apply routing constraints (Recipes 3-3, 3-4, and 3-5)
  • Support remote procedure call (Recipe 3-6)
  • Define greedy “catch-all” routes and prevent controller methods from becoming routes (Recipes 3-7 and 3-8)
  • Apply a message handler to a specific route and use that technique to ignore certain ...

Get ASP.NET Web API 2 Recipes: A Problem Solution Approach 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.