protected async Task <string> PostAsStringAsync(string url, string content) { using (var resp = await BackChannel.PostAsync(url, new StringContent(content))) { return(await resp.Content.ReadAsStringAsync()); } }
public MainPage() { // set up the RaspberryPi raspberryPi = RaspberryPi.Instance; // try catch, because i have exception in function pulseEnable try { // initialize Pi e.g. initialize() for default or customize it for test purposes with initialize(components) raspberryPi.initialize(); //operations = new TestOperations(); operations = raspberryPi.Control; } catch (Exception e) { Debug.WriteLine("Something went wrong during the initialization process of the RasPi : " + e.Message); operations = new TestOperations(); } backChannel = new BackChannel(); Task.Run(() => registerLoop()); serverLoop(); this.InitializeComponent(); }
protected async Task <string> GetAsStringAsync(string url) { return(await BackChannel.GetStringAsync(url)); }