How to Replace WebClient with HttpClient?
I have the following WebClient inside my asp.net mvc web application: using (WebClient wc = new WebClient()) // call the Third Party API to get the account id { string url = currentURL + "resources/" + ResourceID + "/accounts?AUTHTOKEN=" + pmtoken; var json = await wc.DownloadStringTaskAsync(url); } So can anyone advice how I can change it from WebClient to be HttpClient? Hakan Fıstık You can write the following code: string url = currentURL + "resources/" + ResourceID + "/accounts?AUTHTOKEN=" + pmtoken; using (HttpClient client = new HttpClient()) { using (HttpResponseMessage response =