[error] axios error

강수정·2025년 3월 24일

🔥 Axios error

POST요청시 client 측의 API명세서가 잘못됬을 확률이 가장크다.

  1. headers, withCredentials 부분을 따로 분리 했는지 확인
  2. 데이터값 전송시 key: value 형식으로 전송했는지 확인
            const response = await axios.post(
                `http://localhost:${PORT}/END-POINT 지정`,
                {
                    postId: postId,
                    password: nonmemberPw,
                },
                { headers: { 'Content-Type': 'application/json' } },
                { withCredentials: true }
            );

0개의 댓글