public async Task <DispensaryAdmin> GetDispensaryByUsername(string username) { Task <string> stringAsync = client.GetStringAsync(uri + "/Dispensary/" + username); string message = await stringAsync; DispensaryAdmin obj = JsonConvert.DeserializeObject <DispensaryAdmin>(message); obj.Pass = FTCEncrypt.DecryptString(obj.Pass); return(obj); }
public async Task AddDispensaryAdminAsync(DispensaryAdmin dispensaryAdmin) { dispensaryAdmin.Pass = FTCEncrypt.EncryptString(dispensaryAdmin.Pass); string dispensaryAdminAsJson = JsonConvert.SerializeObject(dispensaryAdmin); HttpContent content = new StringContent(dispensaryAdminAsJson, Encoding.UTF8, "application/json"); Console.WriteLine(dispensaryAdminAsJson); await client.PutAsync(uri + "/DispensaryAdmin", content); }