본문 바로가기
Error

statusText: "Unauthorized" Error: Request failed with status code 401

by reo.l 2021. 6. 2.

token 보낼때 headers를 명시해 주어야 한다. 서버에서 headers가 없으면 token을 인식하지 못한다.

null 값으로라도 보내주어야 한다.

 

return axios({
    method: "POST",
    url: `${ROOT_URL}`,
    data: req.data,
    headers: req.headers ? req.headers : null,
  });

 

 

 

 

댓글