How easy to call external Web APIs in Meteor?

Tags: web-api meteor
Question!

Does (or will) Meteor provide a library to handle external Web API calls? E.g. to build a Meteor app that integrates with Facebook Graph API or Google Spreadsheet API.



Answers
Meteor now includes the http package. First, run meteor add http. Then you can make HTTP requests on the server in either sync or async style:

// server sync
res = Meteor.http.get(SOME_URL);
console.log(res.statusCode, res.data);

// server async
Meteor.http.get(SOME_URL, function (err, res) {
  console.log(res.statusCode, res.data);
});

Same thing works on the client, but you have to use the async form.



By : Raynos


HTTP

HTTP provides an HTTP request API on the client and server. To use these functions, add the HTTP package to your project with $ meteor add http.



This video can help you solving your question :)
By: admin