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