title: What is the equivalent way to set post parameters in .net?
body: <p>I have to integrate with a third party API. To use the service, I have to "POST" to a specific url with certain parameters. </p>
  
  <p>The example code provided by the service is in php and is as follows</p>
  
  <pre><code>$data = array('From' =&gt; '0999999', 'To' =&gt; '08888888'); 
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_FAILONERROR, true);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);  &lt;--- Ignore SSL warnings
  curl_setopt($curl, CURLOPT_POST, true); 
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  </code></pre>
  
  <p>I am trying to use the WebRequest class to achieve the same in .net. However, I am a bit confused about how to set the post parameter data. I figured $data above is nothing but a Dictionary. So I created a equivalent dictionary. However, how do I set the post parameters with the dictionary values? </p>
  
  <p>In <a href="http://msdn.microsoft.com/en-us/library/debx8sh9.aspx">http://msdn.microsoft.com/en-us/library/debx8sh9.aspx</a>, they have serialized a string to a byte array and then set is as the post parameter in the dataStream. How do I do the same for a Dictionary? </p>
  
  <p>Or is my approach incorrect? Is there a better way to do this?</p>