Код: Выделить всё
import requests
url='http://nesssi.cacr.caltech.edu/cgi-bin/getmulticonedb_release2.cgi/post'
files={'files': open('file.txt','rb')}
values={'upload_file' : 'file.txt' , 'DB':'photcat' , 'OUT':'csv' , 'SHORT':'short'}
r=requests.post(url,files=files,data=values)
Код: Выделить всё
Error - You must select a file to upload!
Код: Выделить всё
File file.txt of size bytes is uploaded successfully!
Query service results: There were 0 lines.
Некоторые другие темы (но не отвечающие на мою проблему):
- Отправить файл с использованием POST из сценария Python
- http://docs.python-requests.org/en/late ... se-content
- Загрузка файлов с помощью запросов и отправка дополнительных данных
http://docs.python-requests.org/en/late ... t-workflow
Подробнее здесь: https://stackoverflow.com/questions/225 ... n-requests