Thursday, October 11, 2012

How to solve problem, "The operation has timed out at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)"

Need to dispose HttpWebResponse

            using (HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse())
            {
                using (var str = new StreamReader(webresponse.GetResponseStream()))
                    {
                        result = str.ReadToEnd();
                    }
                webresponse.Close();
            }

How to deal with "Content-Length or Chunked Encoding cannot be set for an operation that does not write data"

Server send 303 redirection for the request.  Check your request data if anything wrong .

http://en.wikipedia.org/wiki/HTTP_303