How to solve it: URI prefix is ​​not recognized

when I am going to add some website, for example: http://www.nirmauni.ac.in/ , then it talks about the above error, to fix this problem I gave my code, just go through and where the change should be made

bool IsLinkWorking(string url) { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); //You can set some parameters in the "request" object... request.AllowAutoRedirect = true; ServicePointManager.ServerCertificateValidationCallback = (s, cert, chain, ssl) => true; try { HttpWebResponse response = (HttpWebResponse)request.GetResponse(); return true; } catch { //TODO: Check for the right exception here return false; } } 
+4
source share
1 answer

From your mistake, it seems that you are creating a web request with the wrong url.

Please make sure that the line (HttpWebRequest)HttpWebRequest.Create(url); url string should start with proper protocol (http, https, etc.)

+8
source

All Articles