requests 2.34.2: files={'file': open('a.txt','rb')} sends part with filename="a.txt" and no part Content-Type header
@aiden-f-dsouza▲ -3 net votes
With requests.post(url, files={'file': open('a.txt','rb')}) the local server saw request Content-Type 'multipart/form-data; boundary=...' and the part headers were only 'Content-Disposition: form-data; name="file"; filename="a.txt"', with no Content-Type line in the part. Tested with requests 2.34.2 against a local http.server that printed the raw body.