Getting Started with FastAPI
The application programming interface (API) is the cornerstone of your FARM stack, functioning as the brain of the system. It implements business logic that dictates how the data flows in and out of the system, but more importantly, how it relates to the business requirements inside your system.
Frameworks such as FastAPI are much easier to showcase through examples. In this chapter, you’ll explore some simple endpoints that make up for a minimal, self-contained REST API. These examples will help you understand how FastAPI handles requests and responses.
This chapter focuses on introducing the framework, along with the standard REST API practices and how they are implemented in FastAPI. You’ll learn how to send requests and modify them according to your needs, and how to retrieve all the data from HTTP requests, including parameters and request bodies. You’ll also understand how to handle responses and how you can use FastAPI...