PS - No I am not going to use python requests, cause it does not help creating readable streams of the file.
curl -i -H "Authorization":"eyJhbGciOiJIUzI1NiIsImV4cCI6MTQyNjcwNTY4NiwiaWF0IjoxNDI2NzAyMDg2fQ.eyJpZCI6MTc3fQ.yBwLFez2RnxTojLniL8YLItWVvBb90HF_yfhcsyg3lY" \
-F user_data='{"user data": {"preferred_city":"Newyork","within_radious":"5"}}' \
-F uploaded_documents=@mydocument.pdf \
http://127.0.0.1:5000/api/city
I am trying to send both file and a json data in pycurl post method.
I am succesful in sending file alone only.
I found above example to send file and data in same api but not able to convert it to pycurl systax properly.
Can anyone please convert it to pycurl type code work?