User1315112726 posted
I am trying to access a web site using below snippet
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse webResponse = (HttpWebResponse)httpWebRequest.GetResponse();
This is occuring for particular web site and rest of the web site working fine.
Error:
The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() -532459699...
Also, i tried with below options
1. Adding Credential like
NetworkCredential networkCredential =
new NetworkCredential("user name",
"pwd", "domain");
httpWebRequest.Credentials = networkCredential;
2. Adding below User Agent.
httpWebRequest.UserAgent =
"Mozilla/5.0+";
When i try to access the URL from IE, its working fine. Please help me.