In this recipe, we will learn how to build URLs to respond to GET requests. In other words, we will learn how to serve data to the clients of your API. This means that you will be able to create a REST URL, where you can fetch a collection from data of a given resource—data about clients in this case—or fetch data about a specific resource.
You can either use example codes, which we have used in the recipes from previous chapters, or you can start a new project.
After creating the project, we will need to create a list of clients to serve as an in-memory database. We will need a model class to keep the data that will be shown on the page:
code.modelpackage, let's create a class named