Understanding ForgetMeNot.APIClient
The third API project, ForgetMeNot.APIClient
, has only one class in it – Client.cs
. This is the wrapper of the REST service that the client (ForgetMeNotDemo
) will interact with.
We start with four member variables:
public class Client { RestClient client; [1] string baseUrl; [2] string username; [3] string password;
[1]
As noted earlier, RestClient
is the library we are using to manage the REST interactions (obtained through NuGet, as discussed earlier).
[2]
baseURL
is the prefix for all the API calls and was created when we moved the API to Azure. As noted earlier, it is available at https://forgetmenotapi20230113114628.azurewebsites.net/.
[3]
username
and password
are used by the client to access the user’s record.
The constructor to Client
takes baseUrl
, assigns it to the field, and then...