In the previous section, we successfully modified the WalkEntries
database model that will be used by our TrackMyWalks
application. This will allow us to have a live backend service that will enable our application to communicate over HTTP so that it can send requests to the API to retrieve, add, and delete trail walk entries. In this section, we will need a means for our app to communicate with our API over HTTP, and therefore it will require an HTTP library.
Since we are using .NET and C#, we can use a library within the .NET Framework, called System.Net.Http.HttpClient
. This Framework provides a mechanism for allowing our app to send
and receive
data using standard HTTP methods such as GET
and POST
. We will begin by creating a base service class within our TrackMyWalks
Portable Class Library that will be responsible for handling all the HTTP communications for us.
Let's now start to implement the code required for our WalkWebService...