#16 Requests HELP!


#1

Nothing I have tried has worked, it keeps giving me

"Oops, try again. Did you set xhr equal to new XMLHttpRequest(), then call xhr.open() with the arguments listed? Check the Hint if you need help!"

and the only thing people have been asking about with this part is an issue with https instead of http.

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

// Add your code above this line!

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

Please help me, I have literally been at this for days and I have no idea what is wrong.


#2

codeacademy is spelt wrong in https://www.codeacademy.com/ it should be codecademy not codeacademy


#3

Okay but it still gave me the same error message that I mentioned earlier.


#4

This one worked for me:
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.codecademy.com/", false);
xhr.send();

If you copy the URL from the template form u need to add the httpS because by default it is http://.


#5

try to clear the cache while refreshing the page ('CTRL+F5' instead of just 'F5')


#6

adding s to the http in the web address made it work for me
like so
https://codecademy.com/


#7

this is the answer.. lmao THANK YOU!!


#8

Worked for me too
"https://www.codecademy.com/"


#9

that is!!, thanks you're awesome


#10

It's https not http. I think they should correct it.


#11

The solution involves the codecademy site being HTTPS not HTTP. I understand that the module states the solution incorporates HTTP per the hint provided but this is not correct. Remember, it is a puzzle though :slight_smile:

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

xhr.send();>


#12

Its working :blush:
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.codecademy.com/", false);
xhr.send();
console.log(xhr.status);
console.log(xhr.statusText);


#13

Dang! sa there for lik e10 min.. thanks bud.


#14

I was still having trouble with this problem, even after trying all the fixes mentioned, but I finally just copied and pasted the https from the instructions into the code editor and it passed! Lemme know if that works for y'all!