无效的访问令牌Dropbox API Github页面


var xhr = new XMLHttpRequest();
var filename = name;
//dataset is a valid JSON Object
var file = new File([JSON.stringify(dataset)], filename, { type: "text/json;charset=utf-8" });
xhr.open('POST', 'https://content.dropboxapi.com/2/files/upload');
xhr.setRequestHeader('Authorization', 'Bearer ' + 'accessToken');
xhr.setRequestHeader('Content-Type', 'application/octet-stream');
xhr.setRequestHeader('Dropbox-API-Arg', JSON.stringify({
path: '/Apps/BeachBlitz/' + file.name,
mode: 'overwrite',
autorename: false,
mute: false
}));
xhr.send(file);

有什么方法可以在 Github 页面中运行上述代码吗? 每当我尝试时,我都会收到无效的访问令牌错误。

显然,根据Github页面允许HTTP Post方法,github页面不允许发布请求

所以我问题的答案是否定的,除非你这样做,否则这是不可能的 https://medium.com/pan-labs/dynamic-web-apps-on-github-pages-for-free-ffac2b776d45

最新更新