public async Task <uint> PostAsync(AddDBFunction addDB) { using (HttpClient client = new HttpClient()) { uint ret = uint.MaxValue; StringContent cont = new StringContent(JsonConvert.SerializeObject(addDB)); var response = await client.PostAsync(uri + "/", cont); if (response.IsSuccessStatusCode) { var t = await response.Content.ReadAsStringAsync(); ret = JsonConvert.DeserializeObject <uint>(t); } Globals.AddDB(ret, addDB.IPAddress.ToString()); return(ret); } }