HttpClient failing in accessing simple website
问题 Here is my code internal static void ValidateUrl(string url) { Uri validUri; if(Uri.TryCreate(url,UriKind.Absolute,out validUri)) { using (HttpClient client = new HttpClient()) { try { HttpResponseMessage response = client.Get(url); response.EnsureStatusIsSuccessful(); } catch (Exception ex) { //exception handler goes here } } } } This code when i run it produces this result. ProxyAuthenticationRequired (407) is not one of the following: OK (200), Created (201), Accepted (202),