通过 curl 上传文件

这会将文件从当前文件夹中的本地路径 matrices.txt 上传到 Dropbox 帐户中的/Homework/math/Matrices.txt,并返回上传文件的元数据:

echo "some content here" > matrices.txt

curl -X POST https://content.dropboxapi.com/2/files/upload \
    --header "Authorization: Bearer <ACCESS_TOKEN>" \
    --header "Dropbox-API-Arg: {\"path\": \"/Homework/math/Matrices.txt\"}" \
    --header "Content-Type: application/octet-stream" \
    --data-binary @matrices.txt

<ACCESS_TOKEN> 应替换为 OAuth 2 访问令牌。