Skip to Main Content
ASP.NET Core in Action, Second Edition
book

ASP.NET Core in Action, Second Edition

by Andrew Lock
May 2021
Intermediate to advanced content levelIntermediate to advanced
832 pages
25h 39m
English
Manning Publications
Content preview from ASP.NET Core in Action, Second Edition

9 Creating a Web API for mobile and client applications using MVC

This chapter covers

  • Creating a Web API controller to return JSON to clients
  • Using attribute routing to customize your URLs
  • Generating a response using content negotiation
  • Applying common conventions with the [ApiController] attribute

In the previous five chapters, you’ve worked through each layer of a server-side rendered ASP.NET Core application, using Razor Pages to render HTML to the browser. In this chapter you’ll see a different take on an ASP.NET Core application. Instead of using Razor Pages, we’ll explore Web APIs, which serve as the backend for client-side SPAs and mobile apps.

You can apply much of what you’ve already learned to Web APIs; they use the same MVC design ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Core in Action, Third Edition

ASP.NET Core in Action, Third Edition

Andrew Lock

Publisher Resources

ISBN: 9781617298301Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link