title: Using WebRequest.ContentLength
body: <pre><code>string name = textBox.Text;
  string favColour = textBox1.Text;
  
  ASCIIEncoding encoding = new ASCIIEncoding();
  
  string postData = "name=" + name + "&amp;favColour" + favColour;
  byte[] data = encoding.GetBytes(postData);
  WebRequest request = WebRequest.Create("mywebsite.com");
  
  request.Method = "POST";
  request.ContentType = "application/x-www-form-urlencoded";
  request.ContentLength = data.Length;
  
  Stream stream = request.Get;
  </code></pre>
  
  <p>Visual Studio 2015 has a problem with request.ContentLength.It says that there isn't a definition for ContentLength in WebRequest.</p>