I am new to Meteor.js and want to make my web app work with Dropbox Core API. I am not able to wrap my head around making API calls using the HTTP package in Meteor.js
How can I make a call in Meteor which is similar to the Curl call below :
curl https://api.dropbox.com/1/account/info -H "Authorization: Bearer <access token>"
I wish to get list of files in the directory but for now I am stuck with the Authentical Token.
You can use the HTTP package you mentioned
Add it with
meteor add http
Then to use it (server side). This should produce exactly what the curl
request above gives out.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With