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
mp = aiohttp.MultipartWriter()
mp.append(open('/tmp/test.txt', 'rb'))
result = await session.post(url, data=mp)
but it is not working, the server responses 400. Also I tried
mp.append_form([('file', open('/tmp/test.txt'))])
it is not working too. What is the right way to emulate curl -F with aiohttp?
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 http://docs.aiohttp.org/en/stable/multipart.html#sending-multipart-requests