I am trying to upload a file to django python server through python client.
I tried this -
import requests
url = 'http://wings.spectrumserver/sdm/lists'
files = {'file': open('file.ext', 'rb')}
r = requests.post(url, files=files)
but somehow it is not working. No error but no output/upload as well
I am successfully upload files by browser and command line.
curl -i --form docfile=@localfilename http://wings.spectrumserver/sdm/lists
Please suggest what to do ??
I do not know much about curl and python but maybe someone could suggest something which is replica of this curl command in pycurl
as it is already working with curl.
Please refer here for more details about question -