如何使用Meteor.js对Dropbox API进行CURL调用
我是Meteor.js的新手,想让我的web应用程序与Dropbox核心API一起工作。我无法用Meteor.js中的HTTP包进行API调用 如何在Meteor中进行类似于下面的Curl调用的调用:如何使用Meteor.js对Dropbox API进行CURL调用,meteor,dropbox-api,Meteor,Dropbox Api,我是Meteor.js的新手,想让我的web应用程序与Dropbox核心API一起工作。我无法用Meteor.js中的HTTP包进行API调用 如何在Meteor中进行类似于下面的Curl调用的调用: curl https://api.dropbox.com/1/account/info -H "Authorization: Bearer <access token>" curlhttps://api.dropbox.com/1/account/info -H“授权:持票人” 我
curl https://api.dropbox.com/1/account/info -H "Authorization: Bearer <access token>"
curlhttps://api.dropbox.com/1/account/info -H“授权:持票人”
我希望获得目录中的文件列表,但目前我只能使用Authentical令牌 您可以使用您提到的HTTP包 加上
meteor add http
然后使用它(服务器端)。这应该产生上面的curl
请求所给出的结果
var result = HTTP.get("https://api.dropbox.com/1/account/info", {
headers: {
Authorization: "Bearer <access token>"
}
});
console.log(result.content)
console.log(result.data) //<< JSON form (if api reports application/json as the content-type header
var result=HTTP.get(“https://api.dropbox.com/1/account/info", {
标题:{
授权:“持票人”
}
});
console.log(result.content)
console.log(result.data)//谢谢阿克沙。这正是我需要的。你也可以使用meteor add webstudiopro:Curl如果我有用户名和令牌ID,标题应该是什么?