// 지정한 경로(URL)의 데이터를 주고받을 수 있다. fetch('https://www.naver.com/data') // .json()은 서버에서 받아온 데이터를 자바스크립트 객체로 변환해준다. .then(response => response.json())
Axios 설치 명령어
npm install axios
axios.get(url) .then(response => { // ... })
axios.post(url, data) .then(response => { // ... })
axios.put(url, data) // ... })
axios.delete(url) .then(response => { // ... })
axios.patch(url, data) .then(response => { // ... })