Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Node.js Basics (2014) Building a Command Line Application Making a GET Request with http

Zubeyr Aciksari
Zubeyr Aciksari
21,074 Points

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

Can u please help me here? Thanks!

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

4 Answers

Kevin VanderWulp
Kevin VanderWulp
5,180 Points
var http= require("http");
http.get("http://teamtreehouse.com/chalkers.json", function(response) {
    //function properties go here
});

you should change your http to https

just like what i did below

var https= require("https"); https.get("https://teamtreehouse.com/chalkers.json", function(response) { //function properties are placed here });