$ curl -F myfile=@myfilename -F 'data={"title":"some title","otherinfo" : "aabcdef"}' https://someurl
The above is the working and correct way for doing from terminal.
I tried to implement this in python using requests in this way :
files = {'myfile': open('myfilename', 'rb')}
data = {}
data['data'] = {
'title' : 'some title',
'otherinfo' : 'other info'
}
r = requests.post(url, files=files, data=data, auth=auth)
Here, the data is not reaching the destination properly, where am I wrong ?