GetRequestStream() 사용시 지연문제

WebRequest req = WebRequest.Create(URL);
req.Method = “POST”;
req.ContentType = “application/x-www-form-urlencoded”;
byte[] byteArray = Encoding.UTF8.GetBytes(data);
req.ContentLength = byteArray.Length;

Stream ds = req.GetRequestStream();
ds.Write(byteArray, 0, byteArray.Length);
ds.Close();

req.GetRequestStrream(); 사용시 이상하게 딜레이가 생기는데,
구글의 도움을 얻어보니,
req.Proxy = null;
한줄 추가해주니 딜레이가 사라졌다.

 

Despite the fact that no proxy is configured on the machine, and IE/WinINet
are configured to never use a proxy, with automatic detection disabled,
HttpWebRequest was apparently trying to detect a proxy.

 

답글 남기기