`API函数的主机不正确“;文件/上传";`尝试使用Dropbox API 2上载文件时出错
我想用Dropbox API 2上传文件 我可以通过以下命令获取用户信息:`API函数的主机不正确“;文件/上传";`尝试使用Dropbox API 2上载文件时出错,api,dropbox,Api,Dropbox,我想用Dropbox API 2上传文件 我可以通过以下命令获取用户信息: curl -X POST https://api.dropboxapi.com/2/users/get_current_account \ --header "Authorization: <access token>" \ --header "Content-Type: application/json" \ --data "null" content.dropboxapi.com仅返回未
curl -X POST https://api.dropboxapi.com/2/users/get_current_account \
--header "Authorization: <access token>" \
--header "Content-Type: application/json" \
--data "null"
content.dropboxapi.com
仅返回未找到
json
如何使用Dropbox API 2上传文件?我认为您粘贴的内容(但使用正确的主机)应该可以正常工作。你能分享你试过的curl命令吗?哦,刚刚注意到你用了“test”而不是“path”。当然也要解决这个问题。哦,我应该使用
content.dropboxapi.com
,而不是api.dropboxapi.com
,path
不是在dropbox文件夹中创建的目录名。谢谢!
curl -X POST https://api.dropboxapi.com/2/files/upload \
--header "Authorization: Bearer <access token>" \
--header "Content-Type: application/octet-stream" \
--header "Dropbox-API-Arg: {\"test\": \"/apitest.txt\", \"mode\": \"overwrite\"}" \
--data-binary @foo.txt