Example #1
0
        public async Task CreateOwner(OwnerClass pOwner)
        {
            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri("http://api20180629104437.azurewebsites.net/api/");

            string newOwnerJSON = JsonConvert.SerializeObject(pOwner, Formatting.None);

            var content = new StringContent(newOwnerJSON, Encoding.UTF8, "application/json");

            HttpResponseMessage response = await client.PostAsync("Owners", content);
        }
Example #2
0
        public async Task DeleteOwner(OwnerClass pOwnerToDelete)
        {
            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri("http://api20180629104437.azurewebsites.net/api/");

            string ownersToDeleteJSON = JsonConvert.SerializeObject(pOwnerToDelete, Formatting.None);

            var content = new StringContent(ownersToDeleteJSON, Encoding.UTF8, "application/json");

            HttpResponseMessage response = await client.DeleteAsync("Owners/" + pOwnerToDelete.OwnerID);
        }