In Chapter 4, Controller, Actions and Models, we learnt a lot about Controllers and Actions. Any ASP.NET Web API project will have one or more controllers with many action methods based on HTTP Verbs like GET, POST, PUT, and DELETE.
When we created a basic ASP.NET Core Web API in Chapter 3, Anatomy of ASP.NET Core Web API, and run the application, we saw the URL in the browser as http://localhost:5000/api/values--it displayed the JSON response from the Values Controllers.
A few questions like the following arise here:
- How does the project know it should load a particular controller and action method?
- What if I have many controllers and action methods in a real-world scenario? How do we point to a particular controller?
- What is the mechanism to properly serve the HTTP request?
The mechanism to map incoming HTTP requests to its corresponding controller&apos...