multipart data POST using python requests: no multipart boundary was found
I have a form-data as well as file to be sent in the same POST. For ex, {duration: 2000, file: test.wav}. I saw the many threads here on multipart/form-data posting using python requests. They were useful, especially this one . My sample request is as below: files = {'file': ('wavfile', open(filename, 'rb'))} data = {'duration': duration} headers = {'content-type': 'multipart/form-data'} r = self.session.post(url, files=files, data=data, headers=headers) But when I execute the above code, I get this error: 5:59:55.338 Dbg 09900 [DEBUG] Resolving exception from handler [null]: org