리액트
리액트 컴포넌트에서 axios API 요청하기
axios axios 설치 yarn add axios npm i axios get axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) .finally(function () { // always executed }); post axios.post("url", { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { // response }).catch(function (error) { // 오류발생시 실행 }) dele..
2023. 8. 24. 00:04