What does the send() method do?



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


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

xhr.open('GET', url);

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