How to use APIs with JavaScript - Apigee API - Bug in "16. Requests"


#1

You should change the URL string, because you can only connect with HTTPS, not HTTP.


#2

yes! thank you. I couldn't get passed it even though my code was correct. Should be

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

this 's' is missing on the http in the url - if not added, it will fail you.


#3

Also had this issue, would be useful if it could be fixed!


#4

Took me a good 5-10 minutes to figure out that bug.


#5

Yeah wasted multiple minutes of my morning.. the annoying thing is we can't skip past even when we 'know' our code is correct.. there should be a 'skip and submit' option or something..


#6

thanks for this buddy


#7

I also had the same issue. Had to change to https before it would submit correctly :confused:


#8

It'd be nice if Codecademy would fix this tiny bug in the instructions. Very frustrating, since there's pretty minimal error feedback in these lessons.


#9

This issue still hasn't been fixed


#10

Still not fixed, ran into this today


#11

Even after changing the url to add the 's', it is still not letting me pass. What's happening here?
Code is correct, according to everyone else in here.
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.codecademy.com/", false);


#12

Did you include the send()?


#13

Lol
This bug exists for 239 days
WTF?!
Where's administration that should fix it?!?


#14

HI, I resolve this problem with a blank line between xhr.send(); and the console.log lines . just this

var xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.codecademy.com/", false);
// Add your code below!
xhr.send();
<<< ===== blank space
console.log(xhr.status);
console.log(xhr.statusText);

excuse me for my bad english!! greetings from Venezuela.


#16