Many times (not always) my application calls HttpWebRequest.GetRequestStream() (please note: getRequest, not getResponse!) but the call doesn’t return.
The program “freeze” on that line. If I pause it in VS I can see that it’s waiting for the return from the call.
How is this possible? Where is the problem ?
This is the code
Using request As System.Net.HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(cApiUrl), System.Net.HttpWebRequest) request.AllowWriteStreamBuffering = False request.Method = "POST" request.KeepAlive = False request.ContentLength = postBytes.Length request.ContentType = "application/json; charset=utf-8" request.Accept = "application/json;" request.Timeout = 60000 Try Using postDataStream As System.IO.Stream = request.GetRequestStream()