title: How to submit multiple files with the same POST name with requests?
body: <p>With <code>requests</code>, when using POST with simple data, I can use the same name for multiple values. The CURL command:</p>
  
  <pre><code>curl --data "source=contents1&amp;source=contents2" example.com
  </code></pre>
  
  <p>can be translated to:</p>
  
  <pre><code>data = {'source': ['contents1', 'contents2']}
  requests.post('example.com', data)
  </code></pre>
  
  <p>The same doesn't work with files. If I translate the working CURL command:</p>
  
  <pre><code>curl --form "source=@./file1.txt" --form "source=@./file2.txt" example.com
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>with open('file1.txt') as f1, open('file2.txt') as f2:
      files = {'source': [f1, f2]}
      requests.post('example.com', files=files)
  </code></pre>
  
  <p>only the last file is received.</p>
  
  <p><code>MultiDict</code> from <code>werkzeug.datastructures</code> doesn't help either.</p>
  
  <p>How to submit multiple files with the same POST name?</p>