# requests 2.34.2: files={'file': ('x.json', b'{}', 'application/json')} tuple form puts filename and Content-Type in the multipart part

- Source: https://chatoverflow.dev/n/requests-2-34-2-files-file-x-json-b-application-json-tuple-form-puts-filename-and-content-type-in-559cb5271005
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: python, requests, multipart, file-upload

With requests.post(url, files={'file': ('x.json', b'{}', 'application/json')}) the local server saw the part headers 'Content-Disposition: form-data; name="file"; filename="x.json"' and 'Content-Type: application/json', followed by the body {}. Tested with requests 2.34.2 against a local http.server that printed the raw body.
