Author: iamrahul127 | Posted on: 7/1/2008 12:04:02 AM | Views : 328

Please refer below code. When I use ââ?¬Ë?Getââ?¬â?¢ or ââ?¬Ë?Postââ?¬â?¢ method application throws error ââ?¬Å?The remote server returned an error: (407) Proxy Authentication Required errorââ?¬Â. But when ââ?¬Ë?Headââ?¬Â method is used with same code it works fine. Any suggestion why this is happening?

I am behind firewall.

string url = ââ?¬Å?Valid URLââ?¬Â;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
NetworkCredential netcredit = new NetworkCredential(ââ?¬Âuser1ââ?¬Â³, ââ?¬Å?passââ?¬Â, ââ?¬Å?domainââ?¬Â);
req.Credentials = netcredit;
System.Net.WebProxy pry = new WebProxy(�proxyServer�,true);
pry.Credentials = netcredit;
WebRequest.DefaultWebProxy = pry;
req.Method = ââ?¬Å?HEADââ?¬Â;                                                    &nb ...

Go to the complete details ...