Cannot complete an API Request


#1

I do not understand why my code does not work.

// Add your code below this line!
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.codeacademy.com/", false);
xhr.send();


// Add your code above this line!

console.log(xhr.status);
console.log(xhr.statusText);

#2

There is a bug in the main code

Change this:
xhr.open("GET", "http://www.codeacademy.com/", false);

change to this :

xhr.open("GET", "https://www.codecademy.com/", false);

They forgot an 's' in https


#3

Worked perfect.

Seriously, thank you


#4

Thanks for posting this. Really helped a lot.


#5

You're the real MVP. Thank you. I couldn't find where I went wrong.


#6

4 months later, still not fixed. What's the issue codecademy??


#7

They tell you to use HTTPS. Why does this need a fix?