ReferenceError: Curl is not defined

Hello, I’m a beginner with Meteor.js
In my main.js I have this piece of code:

var url = 'http://www.atelier-fuer-neue-medien.de';
Curl.request(url, function(err, result){
    console.log('OK');
});

When I run this code it says:

ReferenceError: Curl is not defined

meteor list tells me, that I have installed:

...
webstudiopro:curl   0.0.1 A simple wrapper for npm curlrequest
...

I have installed it by

meteor add webstudiopro:curl

My main.js is in the folder '/client’
When I move my main.js in the folder ‘/server’ the build process exits with code 8.

Why is Curl not defined?

Thanks for a hint, Thomas

Don’t use curl for API requests. Use HTTP.

EDIT: maybe I should rephrase … that package raises a few warning flags for me: no githib repo for the Meteor package, no installs, lack of activity. It may be better to try using HTTP even though there may be some features of curl that are not in HTTP.

Thank you for your answer.
I used HTTP.call now and that works fine!

Greetings, Thomas

1 Like