title: Construct form-data with duplicate keys in Nodejs client post request body
body: <p>I am trying to make a post request which body consists of form-data. But the API rest spec, says the form data should look like this :</p>
  
  <blockquote>
    <p>names[]= company name 1&amp;names[]=company name 2</p>
  </blockquote>
  
  <p>I tried </p>
  
  <pre><code>    form: {'names[]': "google" ,'names[]': "kraft",  'fields[]': "Country", 
          'fields[]':"ISIN"}
  </code></pre>
  
  <p>But the server receives only the first <code>names[]</code> and <code>fields[]</code>. The second ones are cut.</p>
  
  <blockquote>
    <p>Server:  Post data: {"names"=>["kraft"], "fields"=>["ISIN"]}</p>
  </blockquote>
  
  <p>Then I tried to add array as value:</p>
  
  <pre><code>form: {'names[]': ["google", "kraft"], 'fields[]': ["Country","ISIN"] }
  </code></pre>
  
  <blockquote>
    <p>Server: Post data: {"names"=>[{"0"=>"google", "1"=>"kraft"}], "fields"=>[{"0"=>"Country", "1"=>"ISIN"}]}</p>
  </blockquote>
  
  <p>Looking at the server request, I see that it accepts body in this format:</p>
  
  <p><code>BODY: names[]=google&amp;names[]=kraft&amp;fields[]=ISIN&amp;fields[]=Country</code></p>
  
  <p>But I cant construct such form in my node-client side.</p>
  
  <p>I am using this library: <a href="https://www.npmjs.com/package/request" rel="nofollow noreferrer">https://www.npmjs.com/package/request</a></p>
  
  <p>********* <strong>EDIT</strong> ********</p>
  
  <p>This one actually woked:
  <code>form: "names[]=google&amp;names[]=kraft&amp;fields[]=Country&amp;fields[]=ISIN"</code></p>
  
  <p>Now the question is how to form this string using <a href="https://github.com/form-data/form-data" rel="nofollow noreferrer">https://github.com/form-data/form-data</a></p>
  
  <p>No append doesn't work I tried. </p>