When sending a multipart request (with files) if we want to attach a metadata field or any field that is nested, currently the user should json.dumps it or it might be ignored by the server (hard to debug).
We should probably improve
|
data = self.dump_json_for_multipart(data) |
so that the user can do:
Example:
client.http_helper.post(files={'file': open('file', 'rb')}, data={'metadata': {'foo': 'bar'}}, content_type=''multipart/mixed'')
Instead of:
client.http_helper.post(files={'file': open('file', 'rb')}, data={'metadata': json.dumps({'foo': 'bar'})}, content_type=''multipart/mixed'')