API Wrapper
·
기술 도입기
안녕하세요! 미어켓 프론트엔드 개발자 이예진입니다 😊이번에는 프론트엔드 팀이 API를 어떻게 호출하고 사용했는지 알려드리겠습니다.일반적으로 API 호출하는 방식// 게시글 목록 가져오기const posts = axios.get('') .then((res) => res.data) .catch((error) => console.error(error));// 게시글 등록const result = axios.post( '', { title: '제목 없음', content: '내용 없음' }, { withCredentials: true }, ) .then((res) => res.data) .catch((error) => console.error(error));물론 이렇게 호출해도 혼자..