title: C#: HttpClient POST pass parameters - one string and int array
body: <p>I'm having some issues with calling an API. I need to send post data containing 2 things: an ID and an array of int. 
  I have tried a lot of things, all resulting in errors or simply not sending data in the right way. All answers I found, do not handle the fact that I want to send 2 different data types.</p>
  
  <p>On the other side I have:</p>
  
  <pre><code>Call&lt;DefaultResponseList&gt; someMethod(@Field("parm1") String parm1, @Field("parm2[]") ArrayList&lt;Integer&gt; parm2);
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>List&lt;int&gt; ints1 = new List&lt;int&gt;();
  ids.Add(1);
  ids.Add(2);
  ids.Add(3);
  
  var values = new List&lt;KeyValuePair&lt;string, object&gt;&gt;
  {
      new KeyValuePair&lt;string, object&gt;("parm1", "lkdjfowejfd123"),
      new KeyValuePair&lt;string, object&gt;("parm2", ints1)
  
  };
  
  var httpClient = new HttpClient(new HttpClientHandler());
  HttpResponseMessage response = await httpClient.PostAsync(someUrl, new FormUrlEncodedContent(values));
  response.EnsureSuccessStatusCode();
  
  string data = await response.Content.ReadAsStringAsync();            
  </code></pre>