FrontEnd

[JavaScript] API 통신 (fetch)

Dean83 2024. 10. 11. 15:42

JavaScript 에서는 fetch 함수를 통해 API 통신을 매우 간단히 할 수 있다. 

 

fetch(url)
.then((response) => response.json())
.then((data) => {
	data.xxxx .....
}).catch((error) => {
	....
});