Bug in 16. Requests (How to use APIs with JavaScript)


Hi all;
I'm Learning How to use APIs with JavaScript

in lesson 16. Requests

I tried to use
xhr.open("GET", "http://www.codecademy.com/", false);
but i cannt pass to next lesson

so i tried to use "https" instead of "http" .. it works :slight_smile:
so please fix it in the web site

link :


I hope they fix it too, sat here for 10 min going, "DA FUQ?!"


I encountered the same issue. The instructions need to be updated to https


I also experienced the same issue, in a way it gets you ready for the kind of things you'll encounter with real-world API's!


I found the issue myself.

I had to change the async flag on the xhr.open to:

xhr.open("GET", "http://www.codecademy.com/", true);


Hey y'all found answer on another post....

add s to http in url. :slight_smile:


My code is correct, and no matter what I do, I can't pass this exercise. The same exact thing happens to me as well on exercise 5, except the error on that one says, "Oops, try again. Did you console.log(xhr.status)?" It puzzles me, because exercise 1 also requires the same code as these exercises, but it will pass me...


I am experiencing the exact same issue! My code is identical to yours and I'm getting the same error. I am very sure I am setting the var xhr to XMLHttpRequest();

You are not alone @opticondude


It seems to work for me now. I tired again after my courses started working again (might be because they added a new course)


Hmm, still nothing for me: I suppose we will see how things go with time... :')



"Call open xhr and pass it three arguments: "GET" (the type of request you'd like to make), "https://www.codecademy.com/" (the URL), and false (this means the exercise will wait until it gets a response from the server)."


so, just spell the name of this site wrong and it should work


I can’t believe they still haven’t fixed this.


Hey, could you explain more? Spell the name of this site wrong and it should work??


I still seem to be getting an incorrect error even with using “https” AND spelling the site name correctly. However, if I use my same code in a Firefox browser instead of Chrome, then the validator counts it as correct. This has happened to me in both lessons 5 and 16. Not totally game-breaking, but it might be something that could frustrate some users.


It seems if you just change “console.log(xhr.statusText);” to “console.log(‘OK’);” then it’ll work.


@netblaster17259 You were right. This is the code.

var xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.codecademy.com/", false);
// Add your code below!


I am finding that none of the above solutions work for me in Chrome. I switched over to IE and logged back in and resubmitted the code from the “hint” and now it will move onto the next lesson. This is beyond frustrating to try and figure out where you aren’t doing things properly, only it isn’t you doing anything improperly it is this site itself having issues.


Just like less 5 in this same section, this “hack” worked.


The learning environment of this course is no longer supported, please update to the supported course:


or if you want to learn es6:


Sure, this work around works, but given the course is no longer supported, over time more bugs will come into the lessons.