title: Post Method and Redirect With Some Values Without Form C#
body: <pre><code>&lt;form action="https://somewebsiteaddrest" method="post"&gt;
     &lt;input name="Var1"  type="hidden" value="Variable 1 value" /&gt;
     &lt;input name="Var2"  type="hidden" value="Variable 2 value" /&gt;
     &lt;input name="Var3"  type="hidden" value="Variable 3 value" /&gt;
     &lt;input name="Var4"  type="hidden" value="Variable 4 value" /&gt;
     &lt;input name="Var5"  type="hidden" value="Variable 6 value" /&gt;
     &lt;input type="submit" value="Go now" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to create equal post method and redirection (in C#) without using this form and <strong>javascript</strong>  <code>frm.submit()</code>;</p>
  
  <p>I've a C# code snippet which I expect to do the stuff.</p>
  
  <pre><code>    WebRequest request = WebRequest.Create(url);
      request.Method = "POST";
      string postData = "What to write here? here should be variable i guess.";
      byte[] byteArray = Encoding.UTF8.GetBytes(postData);
      request.ContentType = "application/x-www-form-urlencoded";
      request.ContentLength = byteArray.Length;
      Stream dataStream = request.GetRequestStream();
      dataStream.Write(byteArray, 0, byteArray.Length);
      dataStream.Close();
      WebResponse response = request.GetResponse();
      Console.WriteLine(((HttpWebResponse)response).StatusDescription);
      dataStream = response.GetResponseStream();
      StreamReader reader = new StreamReader(dataStream);
      string responseFromServer = reader.ReadToEnd();
      Console.WriteLine(responseFromServer);
      reader.Close();
      dataStream.Close();
      response.Close();
  
  
  string postData
  </code></pre>
  
  <p>what to write in postData to get the same effect as it will be by using <code>form</code> and <code>form.submit()</code>? Thanks in advance</p>