データが重複しているリクエストを送信する必要があります。私が聞いたように、リクエストはdictを使用し、dictで重複を取得できないため、重複を送信できません。
取得する必要があるもの (フィドラーから盗聴されたログ)
------WebKitFormBoundaryJm0Evrx7PZJnQkNw
Content-Disposition: form-data; name="file[]"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundaryJm0Evrx7PZJnQkNw
Content-Disposition: form-data; name="file[]"; filename="qwe.txt"
Content-Type: text/plain
example content of file qwe.txt blablabla
私のスクリプト:
requests.post(url, files={'file[]': open('qwe.txt','rb'), 'file[]':''})
=>これだけを取得しました(Fiddlerからのログ)。1つのファイル[]が消えます。
--a7fbfa6d52fc4ddd8b82ec8f7055c88b
Content-Disposition: form-data; name="file[]"; filename="qwe.txt"
example content of file qwe.txt blablabla
私は試した:
requests.post(url, data={"file[]":""},files={'file[]': open('qwe.txt','rb')})
ただし、それはありません: filename="" および content-type
--a7fbfa6d52fc4ddd8b82ec8f7055c88b
Content-Disposition: form-data; name="file[]"
--a7fbfa6d52fc4ddd8b82ec8f7055c88b
Content-Disposition: form-data; name="file[]"; filename="qwe.txt"
Content-Type: text/plain
example content of file qwe.txt blablabla
これを python-requests に手動で追加する方法はありますか?