title: Best way to pass List in query string HttpClient.GetAsync()
body: <p>I use <code>HttpClient.GetAsync()</code> method. I have a list of categories and want to pass it in query string.</p>
  
  <pre><code> var categories = new List&lt;int&gt;() {1,2};
  </code></pre>
  
  <p>How can I pass <code>List&lt;int&gt;/List&lt;string&gt;</code> in query string? 
  For example, <code>https://example.com/api?categories=1,2</code></p>
  
  <p>Of course, can use <code>foreach</code> and <code>StringBuilder</code>. But maybe there is a better way to do this?</p>
  
  <p>For example, work with .PostAsync() and json content very convenient:</p>
  
  <pre><code>var categories = new List&lt;int&gt;() {1,2}; //init List
  var parametrs = new Dictionary&lt;string, object&gt;();
  parametrs.Add("categories", categories); 
  string jsonParams = JsonConvert.SerializeObject(parametrs); // {"categories":[1,2]}
  HttpContent content = new StringContent(jsonParams, Encoding.UTF8, "application/json");
  var response = await httpClient.PostAsync(new Uri("https://example.com"), content);        
  </code></pre>
  
  <p>P.S. I work with Windows Phone 8.</p>