I am sending a POST request this way:
HttpWebResponse res = null; HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url); req.Method = "POST"; req.CookieContainer = cookieContainer; req.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"; req.ContentType = "application/x-www-form-urlencoded"; ASCIIEncoding encoding = new ASCIIEncoding(); byte[] loginDataBytes = encoding.GetBytes(requestCommand); req.ContentLength = loginDataBytes.Length; Stream stream = req.GetRequestStream(); stream.Write(loginDataBytes, 0, loginDataBytes.Length); stream.Close();
I just want to send a request to WebServer, and I don't want to receive a response. It spends time and bandwidth. Anyway, to do this?
Many thanks!
source share