Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor.http method is undefined on server?

Tags:

So, I'm trying to write a method that makes an http call. When I run the method, I get the following error:

Exception while invoking method 'upload' TypeError: Cannot call method 'call' of undefined

Here is what the code looks like:

Client:

console.log(Meteor.call('upload', f, content)); 

Server:

Meteor.methods({   upload: function(file, content) {     this.unblock();     Meteor.http.call("PUT", "http://blah");   } }); 

UPDATE: Problem solved, turns out I had to enable the package: meteor add http

like image 303
Mark Avatar asked Apr 21 '12 23:04

Mark


1 Answers

You simply need to add the HTTP package by running this on command line in your project :

meteor add http

like image 143
Gabriel Dehan Avatar answered Oct 10 '22 19:10

Gabriel Dehan