Updating the phone book application
This time the phone book application is going to work as a web service. The two main tasks that need to be performed are defining the API along with the endpoints and implementing the API. A third task that needs to be determined concerns data exchange between the application server and its clients. There exist four main approaches regarding data exchange:
- Using plain text
- Using HTML
- Using JSON
- Using a hybrid approach that combines plain text and JSON data
As JSON is explored in Chapter 10, Working with REST APIs, and HTML might not be the best option for a service because you need to separate the data from the HTML tags and parse the data, we are going to use the first approach. Therefore, the service is going to work with plain text data. We begin by defining the API that supports the operation of the phone book application.
Defining the API
The API has support for the following URLs:
-
...