0
var xhr = new XMLHttpRequest();
xhr.responseType = 'String';
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var response = xhr.response;
console.log(response);
}
};
xhr.open('POST', 'https://api.dropboxapi.com/2/files/list_folder');
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Dropbox-API-Arg', JSON.stringify({
path: '/lol'
}));
xhr.send();
我找不出在代碼中出現什麼問題。任何幫助?在文檔Dropbox list_folder api javascript不工作
什麼是不正確的工作?你會得到什麼迴應? – Greg