1 Web APIs at a glance

 

This chapter covers

  • Web API overview and real-world case samples
  • Types of web APIs and their pros and cons
  • ASP.NET Core overview
  • Main ASP.NET Core architectural principles

Almost all applications need data, especially web-based applications, in which large numbers of clients interact with a centralized entity—typically, an HTTP-based service—to access information and possibly update or manipulate them. In this book, we’ll learn how to design and develop a specific type of HTTP-based service that has the sole purpose of providing data to these clients, allowing them to interact with the information they require in a uniform, structured, and standardized way: a web API.

In the first section of this chapter, we’ll see the distinctive characteristics of a web API and learn how it can be applied to several real-world scenarios. In the second section, we’ll get familiar with ASP.NET Core, the web framework we’ll be using to create web APIs throughout this book.

1.1 Web APIs

An application programming interface (API) is a type of software interface that exposes tools and services that computer programs use to interact with each other and exchange information. The connection required to perform such exchanges is established by means of common communication standards (protocols), given sets of available operations (specifications), and data exchange formats (JSON, XML, and the like).

1.1.1 Overview

1.1.2 Real-world example

1.1.3 Types of web APIs

1.1.4 Architectures and message protocols

1.2 ASP.NET Core

1.2.1 Architecture

1.2.2 Program.cs

1.2.3 Controllers

1.2.4 Minimal APIs

1.2.5 Task-based asynchronous pattern

Summary

sitemap