HttpWebRequest issues
- by Allen Ho
Hi,
Im still having issues using HttpWebRequest.
For some reason sometimes in my app the call just times out...
HttpWebRequest req = null;
req =
(HttpWebRequest)WebRequest.CreateDefault(new Uri(aRequest));
req.PreAuthenticate = true;
req.AllowAutoRedirect = true;
req.KeepAlive = false;
.....
resp = (HttpWebResponse)req.GetResponse();
resp.close();
I am closing the response but Im just wondering if it is more likely to fail since Im making requests all over the place?
I tried playing around with the ServicePointManager class hoping it would help but it hasnt really
System.Net.ServicePointManager.DefaultConnectionLimit = 100;
System.Net.ServicePointManager.MaxServicePoints = 100;