fetch('url')
.then((response) => response.text())
.then((result) => console.log(result));
๋ธ๋ผ์ฐ์ api ์ด๋ฏ๋ก fetch() ๋ก ์ฌ์ฉ๊ฐ๋ฅํ๋ค.
response.text()๋ promise๊ฐ์ฒด๋ฅผ ๋ฐํํ๋ฏ๋ก then()์ ์ฌ์ฉํ๋ค.
fetch()๋ promise ๋ฅผ ๋ฐํํ๋๋ฐ then์ ์ด์ฉํ๋ฉด response๊ฐ ๋์ฐฉํ์๋์ ํน์ ์์ ์ ํ ์ ์๋ค.