title: aiohttp upload file as curl -F
body: <p>I have a request with curl -F "file=/tmp/test.txt" that responses 200, but I cant emulate this request in Python. I tried something like this </p>
  
  <pre><code>mp = aiohttp.MultipartWriter()
  mp.append(open('/tmp/test.txt', 'rb'))
  result = await session.post(url, data=mp)
  </code></pre>
  
  <p>but it is not working, the server responses 400. Also I tried </p>
  
  <pre><code>mp.append_form([('file', open('/tmp/test.txt'))]) 
  </code></pre>
  
  <p>it is not working too. What is the right way to emulate curl -F with aiohttp?</p>
  
  <p>P.S. I also tried to use set_content_disposition() to the result of mp.append(), but it returns None instead of Payload, as it is described in the docs here <a href="http://docs.aiohttp.org/en/stable/multipart.html#sending-multipart-requests" rel="nofollow noreferrer">http://docs.aiohttp.org/en/stable/multipart.html#sending-multipart-requests</a></p>