Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
`API函数的主机不正确“;文件/上传";`尝试使用Dropbox API 2上载文件时出错_Api_Dropbox - Fatal编程技术网

`API函数的主机不正确“;文件/上传";`尝试使用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仅返回未

我想用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
仅返回
未找到
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