How to make Dropbox curl API call using Meteor.js

I am new to Meteor.js and want my web application to work with the Dropbox Core API. I can't get around the API call using the HTTP package in Meteor.js

How can I call Meteor, which is similar to calling Curl below:

curl https://api.dropbox.com/1/account/info -H "Authorization: Bearer <access token>" 

I want to get a list of files in a directory, but at the moment I'm tied to Authentical Token.

+6
source share
1 answer

You can use the HTTP package you specify

Add it with

 meteor add http 

Then use it (server side). This should result in a curl request being issued.

 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 
+9
source

Source: https://habr.com/ru/post/983954/


All Articles