private void SendToCloud <T>(T val) { var uri = new Uri(uri_box.Text); var json = JsonConvert.SerializeObject(val); var stringContent = new StringContent(json, Encoding.UTF8, "application/json"); // Fire and forget Task.Run(async() => { var resp = await client.PostAsync(uri, stringContent); if (!resp.IsSuccessStatusCode) { vis.setLogger(resp.ToString()); } }); }
public void writetologger(string s) { vis.setLogger(s); }