1GET /hello.html HTTP/1.1
2User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
3Host: www.tutorialspoint.com
4Accept-Language: en-us
5Accept-Encoding: gzip, deflate
6Connection: Keep-Alive
7
1const xhr = new XMLHttpRequest();
2
3let method = 'GET';
4let endpoint = 'what you looking for';
5
6xhr.open(method, endpoint);
7xhr.send();
8
9xhr.onload = () => {
10 'working what you get'
11};