1{
2 "users": [
3 {
4 "id": 0,
5 "name": "Adam Carter",
6 "work": "Unilogic",
7 "email": "adam.carter@unilogic.com",
8 "dob": "1978",
9 "address": "83 Warner Street",
10 "city": "Boston",
11 "optedin": true
12 },
13 {
14 "id": 1,
15 "name": "Leanne Brier",
16 "work": "Connic",
17 "email": "leanne.brier@connic.org",
18 "dob": "1987",
19 "address": "9 Coleman Avenue",
20 "city": "Toronto",
21 "optedin": false
22 }
23 ],
24 "images": [
25 "img0.png",
26 "img1.png",
27 "img2.png"
28 ],
29 "coordinates": {
30 "x": 35.12,
31 "y": -21.49
32 },
33 "price": "$59,395"
34}
35
1fetch('https://jsonplaceholder.typicode.com/todos')
2 .then(response => response.json())
3 .then(json => console.log(json))
1var xhr = new XMLHttpRequest();
2xhr.open("GET", "https://reqres.in/api/products/3", true);
3xhr.onload = function(){
4 console.log(xhr.responseText);
5};
6xhr.send();
7