Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Meteor.js对Dropbox API进行CURL调用_Meteor_Dropbox Api - Fatal编程技术网

如何使用Meteor.js对Dropbox API进行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“授权:持票人” 我

我是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“授权:持票人”

我希望获得目录中的文件列表,但目前我只能使用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,标题应该是什么?