Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Node.js Basics 2017 Building a Command Line Application Making a GET Request with https

Please help because i'm stuck

Now, in the http.get() call pass in an anonymous function as a callback with the parameter of response. This function is the second parameter in the get call.

app.js
var http = require("http");
var https = require("https");
http.get("http://teamtreehouse.com/chalkers.json")
https.get("https://teamtreehouse.com/chalkers.json")

yea i plugged this is in and im pretty sure it is wrong because there is no callback for the function.

Steven Parker
Steven Parker
229,644 Points

The callback is added in task 3. Matas was apparently stuck at task 2.

2 Answers

Steven Parker
Steven Parker
229,644 Points

There's a typo in the challenge.

Instead of "http.get()", the instructions should say "https.get()". Add your callback to that call.

Also, the instructions in the earlier tasks do not ask for the http module to be included or called. The typo might have been more obvious if you had not added them to start with.

bcan you write me the code, how it has to be look like

Steven Parker
Steven Parker
229,644 Points

I'd rather not give an explicit answer. If you're not sure how to construct your callback, I recommend that you take another look at the examples shown in the video.