private async void createURI(string target, string qsParameter, string qsValue) { /* * var uri = UriExtensions.CreateUriWithQuery(new Uri(target), * new NameValueCollection { { qsParameter, qsValue } }); * * HttpClient httpClient = new HttpClient(); * string responseBodyAsText = await httpClient.GetStringAsync(uri); * * getSearchResults(responseBodyAsText); */ var client = new HttpClient(); var uri = UriExtensions.CreateUriWithQuery(new Uri(target), new NameValueCollection { { qsParameter, qsValue } }); // call sync var response = client.GetAsync(uri).Result; var responseString = ""; //checking if request was successful if (response.IsSuccessStatusCode) { responseString = await response.Content.ReadAsStringAsync(); getSearchResults(responseString); } else { searchProgressRing.IsActive = false; var title = "Error with Application"; var message = "It's not you, it's me! Unfortuantely there is an error connecting with the Clique Service"; errorDialog(title, message); } }