What does the send() method do?


#1

Question

In the context of this exercise, what does the send() method for an XHR request do?

Answer

If we take a look at our code, the last two lines are

xhr.open('GET', url);
xhr.send();

The open() method is used to set the request type, GET, and the specified URL to send the request to.

Then, the send() request is used to send the XMLHttpRequest to the specified URL.


FAQ: Requests I - XHR GET Requests II