Adding the save and delete actions in POIService
In
Chapter 4, Adding a ListView, we created the specialized POIService
class that handles the logic for downloading data using the async
and await
keywords in conjunction with HttpClient
. For now, the POIService
class has only one method GetPoisListAsync()
, that deals with fetching the list of records from the REST web service. Let's extend its functionality to create a new or update and delete a POI. Let's first start with creating a POI.
Consuming the web service to create or update a POI
At this point, we have already deployed the web service provided in the book code bundle, and POIApp
is already consuming the same web services to fetch the list of POIs. In this section, we will use the same web service to create a new or update an existing POI.
The following API specification is used to create a new or update an existing POI:
Request Method: POST Resource Endpoint: /com.packet.poiapp/api/poi/pois Content-type: application/json Request Body...