호출방식
- fetch : javascript 에서 api 호출할수 있도록 제공하는 내장함수
let response = fetch('https://jsonplaceholder.typicode.com/posts');
response.then( (res) => {
console.log(res);
})
//결과값 :

위와 같이 호출을 하게 되면 예를 들어 편지를 보낼경우 상대방 답장에 대한 편지내용을 보는게 아닌 편지지를 보는것이다.
async function getData () {
let rawResponse = await fetch('https://jsonplaceholder.typicode.com/posts');
let jsonReponse = await rawResponse.json();
console.log(jsonReponse);
}
getData();
//결과값 : 배열에 객체가 담겨서 넘어옴