API Controllers

This chapter introduces API controllers. An API controller is just an MVC controller that doesn't return a UI but instead works with requests and payloads and returns responses in machine-readable formats, such as JSON or XML. We will cover a number of aspects related to API controllers, from security to versioning.

The following topics will be covered in this chapter:

  • Introduction to REST
  • Model binding
  • Authorizing access to resources
  • Applying OpenAPI conventions
  • Returning validation results
  • Performing content negotiation
  • Handling errors
  • Understanding API versioning
  • Generating API documentation
  • Serving OData

By the end of this chapter, we will be able to work with authentication and validation overall, without much human ...

Get Modern Web Development with ASP.NET Core 3 - Second 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.