XIII XIII

XIII XIII

  • NA
  • 14
  • 2.3k

about http Post

Jul 15 2014 10:09 AM
why when i try to send http post , my Project for a few sec send not responding
 
my code
 
 
string ResP = "";
System.Net.WebRequest req = System.Net.WebRequest.Create(URI);
req.ContentType = "application/x-www-form-urlencoded";
req.Method = "POST";
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(Parameters);
req.ContentLength = bytes.Length;
System.IO.Stream os = req.GetRequestStream();
os.Write(bytes, 0, bytes.Length);
os.Close();
System.Net.WebResponse resp = req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
ResP = sr.ReadToEnd().Trim();

Answers (7)