# 001.jpg是已经存在的文件path = (os.path.join(os.path.dirname(os.path.abspath(__file__)),'001.jpg'))files = { 'file' : open(path, 'rb')}new_url = 'http://127.0.0.1:8000/uploadfile/uploadfile?key=sq0L56z20Xco'r = requests.post(url=get_sucai_url, files=files)print(r.text)
官方文档