gpt4 book ai didi

curl - 使用 Curl 和 Oauth 2 将文件上传到 DropBox 的 DropBox API PUT 示例

转载 作者:行者123 更新时间:2023-12-02 04:27:52 25 4
gpt4 key购买 nike

我到处搜索,一直找不到合适的示例,而且我不够精通,无法通过文档进行整理。比我知识更多的人可以告诉我如何为 OAUTH 2 形成 CURL 命令吗?是不是我只需要 OAUTH 2 key ?我看到了应用程序 key 、应用程序 secret 和 oauth 2。如果重要的话,我会在 perl 脚本中使用它。

我找到的最接近的代码是这样的:

 curl --request PUT --header "Content-Length: `ls -la jonathan.txt | awk '{ print $5}'`" --header         
"Content-Type: multipart/mixed" --data-binary "@jonathan.txt" "https://api-
content.dropbox.com/1/files_put/dropbox/jonathan.txt?access_token=ABCDEF"

但我不认为那是 OAUTH 2?

最佳答案

如果您有访问 token (通过应用控制台创建):

curl -H "Authorization: Bearer <your token>" https://api-content.dropbox.com/1/files_put/auto/ -T <your file path>

关于curl - 使用 Curl 和 Oauth 2 将文件上传到 DropBox 的 DropBox API PUT 示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52163382/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com