
[React] Ajax - axios
·
Archive
Ajax - Axios library : 브라우저, Node.js를 위한 promise API를 활용하는 HTTP 비동기 통신 라이브러리 > axios setting yarn add axios npm install axios GET / POST GET : 서버에서 데이터를 받아온다. axios.get('get요청할url') .then (( ) => { 요청 성공시 실행코드 }) .catch ( ( ) => {요청 실패시 실행코드 }) > then 콜백함수 안에 파라미터를 추가하면 그게 받아온 데이터이다. { axios.get("https://codingapple1.github.io/shop/data22.json") .then((result) => { console.log(result.data)}) .c..