언어가 달라서 json 형태로 정보 공유
then이 하는 일은 응답을 받는데
첫 번째 then: 콜백함수를 받는다. 응답을 json method로 변환.
response.json()
백엔드에서 전달해주는 키와 형태가
//프론트에서 백엔드로 요청
fetch("API 주소", {
method: "POST",
body: JSON.stringify({
email: id,
password: pw,
}),
})
//백엔드에서 요청을 받는다
.then((response) => response.json())
//위에서 반환된 객체를 아래에서 확인한다
.then((result) => console.log("결과: ", result));