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 trialKarl M
14,111 PointsGet request has all https references however still error 301 appears?
Here is my code below, i still receive error message 301 even after converting to everything to "https" !? Need some help please :)
2 Answers
Dino Paškvan
Courses Plus Student 44,108 PointsIf you remove the www.
part from the URL, you'll get 200
.
https.get("https://teamtreehouse.com/" + username + ".json", function (response){
Iver Band
8,389 Points//Full answer: Need to fetch and reference the https module, not the http one per the video
var https = require("https");
var request = https.get("https://teamtreehouse.com/" + username + ".json", function(response){ console.log(response.statusCode);
Karl M
14,111 PointsKarl M
14,111 PointsThanks a million Dino! Two heads are better than one.