title: python requests upload large file with additional data
body: <p>I've been looking around for ways to upload large file with additional data, but there doesn't seem to be any solution. To upload file, I've been using this code and it's been working fine with small file:</p>
  
  <pre><code>with open("my_file.csv", "rb") as f:
      files = {"documents": ("my_file.csv", f, "application/octet-stream")}
      data = {"composite": "NONE"}
      headers = {"Prefer": "respond-async"}
      resp = session.post("my/url", headers=headers, data=data, files=files)
  </code></pre>
  
  <p>The problem is that the code loads the whole file up before sending, and I would run into MemoryError when uploading large files. I've looked around, and the way to stream data is to set</p>
  
  <pre><code>resp = session.post("my/url", headers=headers, data=f)
  </code></pre>
  
  <p>but I need to add {"composite": "NONE"} to the data. If not, the server wouldn't recognize the file.</p>