I keep getting an error saying 'Invalid URI: The format of the URI could not be determined.'
The error happens on line 3
This is my code:
public static string Get()
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"27.**.***.14");
request.MaximumAutomaticRedirections = 4;
request.MaximumResponseHeadersLength = 4;
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream receiveStream = response.GetResponseStream();
StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
string result = readStream.ReadToEnd();
response.Close();
readStream.Close();
return result;
}
Edit: it turns out that I was missing a http:// in front of the IP address, doing this solved the issue