[axios] post, get, delete에 객체 전달하기

Edward Hyun·2022년 4월 19일
0

app&web-dev

목록 보기
106/178

DELETE 요청의 두 번째 인자에 data: {} atrribute를 넣어주면 된다.

Axios.delete(`/post/like`, {
    data: { // 서버에서 req.body.{} 로 확인할 수 있다.
      postId: ...
      commentId: ...
    },
    withCredentials: true,
  });

Axios - delete 요청 시 body에 데이터 넣는 법
출처 : https://velog.io/@bigbrothershin/Axios-delete-%EC%9A%94%EC%B2%AD-%EC%8B%9C-body%EC%97%90-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EB%84%A3%EB%8A%94-%EB%B2%95

profile
앱&웹개발(flutter, vuejs, typescript, react), 인공지능(nlp, asr, rl), 백엔드(nodejs, flask, golang, grpc, webrtc, aws, msa, nft, spring cloud, nest.js), 함수형 프로그래밍(scala, erlang)을 공부하며 정리합니다.

0개의 댓글