So, I am attempting to write an MVC application using some code I wrote from my WPF application. The below code is used in both.
System.Net.WebRequest req = System.Net.WebRequest.Create(URI);
System.Net.WebResponse resp = req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
return sr.ReadToEnd().Trim();
However, in WPF, I get a response back, but in MVC, I get a System.Net.WebException error "Unable to connect to the remote server". I can also access the page through Internet Explorer.