I am POSTing files from Python to a vendor's API, and the vendor's API is complaining that the content is missing size in the Content-Disposition header. The example they give is like:
Content-Disposition: form-data; filename=filename; name=name; size=1234
Is there a Python HTTP client that will let me include the size without re-writing everything from scratch? Requests uses urllib3 for file POSTing, and those don't seem to support setting the size of the file attachment.
request.body, it's like'--d1cfff1341d94dd293f9aafd98ebc6e5\r\nContent-Disposition: form-data; name="my_file"; filename="filename.json"\r\nContent-Type: application/json\r\n\r\n...file...\r\n--d1cfff1341d94dd293f9aafd98ebc6e5--\r\n'. I can add more headers, likeContent-Type: application/json, but I don't see any way to change theContent-Disposition. - Carl