Consuming REST Services
Up until now, when we needed data, we faked it by using hardcoded objects. In a real-world program, however, you will get most of your data from local databases (as discussed in Chapter 8), or you will interact with a service in the cloud through an API. You can interact using one of several architectures, of which the most popular for .NET MAUI is, arguably, Representational State Transfer (REST).
REST is a pattern that describes how classes interact across the internet. The key to REST is that it is stateless – that is, a sustained connection between the client and the API is not needed.
The Forget Me Not architecture is designed to use a REST service and database, which will manage membership, authentication, and persistence of user data. In this chapter, we will look at the following:
- Using REST services
- The Forget Me Not API architecture
- API domain objects
- Data Transfer Objects (DTOs)
- The API Client class
- Using the...