[TIL] axios header

Captainjack·2022년 1월 14일
0

TIL

목록 보기
131/260

axios({
  method: "post",
  url: "/api",
  headers: { Authorization: localStorage.getItem("cookie") },
  data: {}
}).then(response => {
  this.user_validation = true;
  this.user_name = response.data.name;
  this.user_phone = response.data.tel;
  this.user_counsel_count = response.data.counseling_count;
  this.user_apply_kit = response.data.kit_name;
  this.user_apply_address = response.data.address;
  this.user_kit_shipping_check = response.data.kit_send;
  this.user_healing_contents_list = response.data.my_content_list.slice(
    0,
    4
  );
  

postman Authorization token 부분 headers 키 값에 value를 객체로 보내니 확인 완료

profile
til' CTF WIN

0개의 댓글