System.Net.WebException : Cannot handle redirect from HTTP/HTTPS protocols to other dissimilar ones.
My C# code looked like this:
string webPageText;
using (WebClient client = new WebClient())
{
webPageText = client.DownloadString("http://www.myserver.com/appname/params");
}
It took me too long to understand the error message. The real problem is that my app was issuing a 302 redirect and my C# code doesn't know how to handle that. It failed the unit test, which is what it should have done. Once I corrected my input, the redirect to an error page was not raised, and my test passed.
No comments:
Post a Comment