Код: Выделить всё
import os
import requests
import shutil
path = "/Users/mycode/Documents/API upload/"
api_endpoint = "xxxxxx"
files = {
'file': open(p,'rb') for p in os.path.abspath(path)
}
for file in os.path.abspath(path):
response = requests.post(url=api_endpoint, files=files)
if response.status_code == 200:
print(response.status_code)
print("success!")
else:
print("did not work")
^, что означает эта ошибка? Я попробовал погуглить, но в моем случае так и не понял. Это как-то связано с путями, но не знаю почему.
все помогает!
Подробнее здесь: https://stackoverflow.com/questions/725 ... xplanation
Мобильная версия