我正在编写一个用于同步文件的Python客户端。当我阅读一个驱动器API文档时,我感到很困惑。我的代码无法上传文件,因为api返回消息:
{"error":{"code":"invalidRequest","message":"API not found"}}
我的代码:
self.header = {"Authorization": "Bearer " + self.token}
URL = 'https://api.onedrive.com/v1.0/drive/root:/folder/js.json:/content'
with open(path_in_pc, 'rb') as file:
request = requests.post(URL, headers=self.header, data=file)
谁能告诉我为什么这不起作用?