22.04.30
api에 POST 요청방법
axios.post(url, data 객체)
.then((response) => {
console.log(response);
});
data 객체 형식
{ "first_name": "White", "last_name": "Rabbit" , "email": "alice@elice.io" }
이때 response에 반환되는 데이터를 가져오고 싶다면 respons.data
와 같은 형식으로 가져온다.
api에 GET 요청방법
axios.get(url)
api에 PUT 요청방법
axios.put(url, data 객체)
.then((response) => {
console.log(response);
});
api에 DELETE 요청방법
axios.delete(url)
status.innerHTML = response.status