I'm playing around with the Python Requests module that has so far been a delight.
However, I've run into an issue whilst attempting to post a zip file using multipart/form-data.
I'm using Digest authentication and have been able to successfully post other file types e.g. .xls etc.
I'm creating a post request using:
file = open('/Users/.../test.zip', 'rb').read()
r = requests.post(url, auth=HTTPDigestAuth('dev', 'dev'), data = {"mysubmit":"Go"}, files={"archive": ("test.zip", file)})
This errors out and gives:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.2.2.70', port=80): Max retries exceeded with url: /plugin_install
(Caused by <class 'socket.error'>: [Errno 32] Broken pipe)
I've tried with smaller size zip files and changing the data/files values, and the same error occurs.
Am I missing something obvious?
Thanks for any light you can shed!