I made a Function for a program, which does work when the Request Type is GET
, if it is POST
, it always produces a Timeout Exception(and the timeout of
So does it hang on req.GetRequestStream()
every time, or does it work "a few tries" and then hang?
If it works a few times and then hangs, it's possible that you're not closing the requests properly, which is causing you to run out of connections. Make sure to Close()
and/or Dispose()
the HttpWebResponse
objects and all of the Streams and Readers that you're creating.
You have to use response.Dispose();
end of the method