public TestTeble GetTestTableById(int id) { var result = _client.GetStringAsync(apiurl + "/" + id).Result; TestTeble testTeble = JsonConvert.DeserializeObject <TestTeble>(result); return(testTeble); }
public void AddTest(TestTeble testteble) { string jsontest = JsonConvert.SerializeObject(testteble); StringContent content = new StringContent(jsontest, Encoding.UTF8, "application/json"); var res = _client.PostAsync(apiurl, content).Result; }