HttpClient client = new HttpClient(); var uri = new Uri(string.Format("http://localhost:59803/api/Controller/ActionName?username=" + model.Email + "&Password=" + model.Password)); HttpResponseMessage response; ; client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); response = await client.GetAsync(uri); if (response.StatusCode == System.Net.HttpStatusCode.Accepted) { var errorMessage1 = response.Content.ReadAsStringAsync().Result.Replace("\\", "").Trim(new char[1] { '"' }); //Toast.MakeText(this, errorMessage1, ToastLength.Long).Show(); } else { var errorMessage1 = response.Content.ReadAsStringAsync().Result.Replace("\\", "").Trim(new char[1] { '"' }); //Toast.MakeText(this, errorMessage1, ToastLength.Long).Show(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)