{ "read_only":false,"revision":163,"bytes":50459,"thumb_exists":true,"rev":"a341d3afbb","modified":"Sun,28 Feb,201615:08:41 +0000","mime_type":"image/jpeg","size":“49.3KB”,"path":"/undefined/girl.jpg","is_dir":false,"modifier":null,"root":"dropbox","client_mtime":"Sun,28 Feb 2016 15:08:41 +0000","icon":"page_white_picture",
“类型”:“图像/jpeg”,“名称”:"girl.jpg","downloadLink":"http://localhost:5500/proxy?path=https%3A%2F%2Fapi-content.dropbox.com%2F1%2Ffiles%2Fauto%2Fdropbox%2Fundefined%2Fgirl.jpg&access_token=ccpsw20fvhoac9g2:cibllca6q9vr2m5@27hvto4ucs4y8mw","id":“未定义/Girl.jpg”}
这是我使用hello.js的api()函数时得到的json响应这里是我在onclick事件函数getName(网络){上调用的函数
hello("dropbox").api('me/files', 'get',{
path: "/undefined/girl.jpg",
}).then(function(json){
log(json);
}, function(e){
alert('errrr ! '+ e.error.message);
});
return false;
}但是,当我从json响应中复制downloadLink并通过postman运行它时,我得到{"error":"File not File“}
真正的问题是,我可以通过hello.js从dropbox下载资源吗?如果我可以,那我怎么做??注意:在本地主机上运行oauth-shim
发布于 2016-04-01 03:37:42
这个http://localhost:5500/proxy?path=真的在Dropbox的响应中吗?这意味着您正在通过代理服务器访问API,这将重写它们的响应。如果你要剥离它并解码剩下的部分,它应该可以工作-但你真的需要弄清楚为什么你的请求要通过代理服务器并解决这个问题。
https://stackoverflow.com/questions/36342150
复制相似问题