0
我想获取上传文件的临时链接,但正在与内容类型标题争执。我已经尝试了几种Content-Type
标题的组合,但是却遇到了错误。另外,如何使用功能dbx.filesGetTemporaryLinks
而不是此代码。请让mw知道。Dropbox - 获取文件的临时链接
这里是我的代码:
var urltemp = "https://api.dropboxapi.com/2/files/get_temporary_link "; jQuery.ajax({ "url": urltemp, "method": "POST",
"data": {
"path": "filepath"
},
"headers": {
"authorization": authorization,
'Content-Type': 'application/json; charset=utf-8'
//"Content-Type" :'text/plain; charset=dropbox-cors-hack'
},
body: JSON.stringify(null),
success: function(data) {
alert("success");
},
error: function(response) {
alert("error " + JSON.stringify(response));
}
你会得到什么错误?另外,你使用'filesGetTemporaryLinks'有什么麻烦? (虽然后者可能更适合在自己的帖子中) – Greg
您好格雷格,感谢您的回复..错误与内容类型头 - 请求主体无法解码输入为Json..status 400,状态不良请求。 。我尝试了几种内容类型头的组合。 – user7213078