title: How can I send an array as a parameter of a query string in c#?
body: <p>I am trying to use a home grown web API to retrieve some data. The documentation is all written in PHP. The example I'm looking at is this:</p>
  
  <pre><code>$params = array(
      'id' =&gt; 1
      ,'data' =&gt; array(
          ,'email' =&gt; 'example@hasoffers.com'
      )
  
  $url = "www.someapi.com/api?" . http_build_query( $params );
  </code></pre>
  
  <p>I'm using the C# WebClient class, but I can't figure out how to serialize the data parameter:</p>
  
  <pre><code>WebClient wc = new WebClient();
  wc.QueryString["id"] = "1";
  wc.QueryString["data"] = // I have no idea.
  
  string json = wc.DownloadString(apiUrl);
  </code></pre>
  
  <p>I've tried a few variations:</p>
  
  <pre><code>wc.QueryString["data"] = "email=test@stackoverflow.com";
  wc.QueryString["data"] = Uri.EscapeDataString("data[email]=test@stackoverflow.com");
  wc.QueryString["data"] = Uri.EscapeDataString("email[0]=test@stackoverflow.com");
  wc.QueryString["data"] = Uri.EscapeDataString("email=test@stackoverflow.com");
  </code></pre>
  
  <p>Of course, I don't have PHP setup anywhere to see what the http_build_query() is actually returning.</p>