The Remote server returned an error :(407) Proxy Authentication Required

L

Learning.Net

Hi All,
I have an windows application created in C# &it is running fine on
several of our customer.
It does a httpWebrequest in the background.
Everything was working fine but some customer are facing
"The Remote server returned an error :(407) Proxy Authentication
Required "
Please help me on this proxy issue!!

Code Snippet Below:::

{
WebRequest request = WebRequest.Create("http://TServer.com/
sample.aspx");
request.Method = "POST";
string postData = "Pass";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse response = request.GetResponse();
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer);
reader.Close();
dataStream.Close();
response.Close();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top