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 trialKarly Lamm
7,865 PointsI dont know what I am missing
I keep getting the error: Bummer: You haven't added the dataChunk
to responseBody
.
But to my understanding, I have done this.
const https = require("https");
const request = https.get("https://teamtreehouse.com/chalkers.json", response => {
let responseBody = "";
response.on("data", dataChunk => {
responseBody += dataChunck ;
});
response.on("", () => {
console.log(responseBody);
});
});
request.on("error", error => {
console.error(error.message);
});
3 Answers
Steven Parker
231,236 PointsIt's just a spelling error, you have "dataChunck" (with an extra "c") instead of "dataChunk".
Mark Casavantes
10,619 PointsI am not sure you can have a constant variable "https". Is https a reserved word? I am not sure.
Steven Parker
231,236 PointsThat's not only OK, it's the "best practice" convention to use that variable name for that module.
Mark Casavantes
10,619 PointsThank you Steven,
I respect and value your advice.
Thank you,
Mark