API 정의

JSONPlaceholder - Free Fake REST API

let response = fetch('https://jsonplaceholder.typicode.com/posts').then((res) =>
	console.log(res)
};

이렇게 받으면 Response 객체 자체를 반환 받음

Untitled

async function getData(){
	let rawResponse = await fetch('https://jsonplaceholder.typicode.com/posts');
	let jsonResponse = await rawResponse.json();
	console.log(jsonResponse);
} 

getData();

Untitled