axios get header authorization key code example

Example 1: axios header authorization

// Send a GET request with the authorization header set to
// the string 'my secret token'
const res = await axios.get('https://httpbin.org/get', {
  headers: {
    authorization: 'my secret token'
  }
});

Example 2: axios post headers authorization

//Data:name and passWord
//url:https://api-dev.thebar.ke
axios.post("url","Data").then(res => {
console.log(res)
localStroge.setItem("access",accessToken)
localStroge.setItem("refresh",refreshToken)
})
//برای لاگین فقط باید اطلاعتی که از ورودی گرفته میشود در هیدر فرستاده شود اگر اطلاعات فرستاده شده درست باشد شما می توانید به توکن دسترسی داشته باشد
//jaberBatoii