목록2024/06/25 (1)
훈돌라
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bnxtdg/btsIcFliuTa/zhKE7IzLC9XqoglzhV0vk0/img.png)
CountriesApi.tsapi 호출import axios from "axios";export const CountriesApi = async () => { try { const response = await axios.get("https://restcountries.com/v3.1/all"); return response.data; } catch (error) { console.error("컨트리 못 불러옴", error); throw error; }}; try 블록 내에서 axios.get 메서드를 사용하여 https://restcountries.com/v3.1/all 로 GET 요청을 보낸다.이 요청이 성공하면, 응답 데이터 (response.data)를 반환한다.요청..
카테고리 없음
2024. 6. 25. 20:45