
Fetch 란? 웹 브라우저에서 웹 서버에 HTTP 요청을 할 수 있다. Request나 Response와 같은 HTTP의 파이프라인을 구성하는 요소를 조작하는 것이 가능하다. API 요청할 때 사용 사용법 // url는 openweathermap로 작성하였음 fetch(url, options).then((response) => console.log(response)); // 요청이 성공한 경우 Response 객체를 반환함. fetch(url, options).then((response) => console.log(response)) .catch((error) => console.log(error); // catch 구문을 추가하여 예외처리도 할 수 있다. 첫번째 인자로 url, 두번째 인자로 opti..