JavaScript/REST API
-
Axios 사용하기JavaScript/REST API 2024. 6. 12. 14:38
GET: 데이터 조회 axios.get(url)POST: 데이터 등록 axios.post(url, data)PUT: 데이터 수정 axios.put(url/id 값, data)DELETE: 데이터 제거 axios.delete(url/id 값) TEST API JSimport axios from "axios";export default class Memo { constructor() { this.apiClient = axios.create({ baseURL: "http://localhost:3001", }); } async getMemos() { try { const response = await this.apiClient.get("memo"); cons..