Answers for "how to globally set axios headers"

11

header in axios

axios.post('url', {"body":data}, {
    headers: {
    'Content-Type': 'application/json'
    }
  }
)
Posted by: Guest on September-24-2020
0

set variable to header axios

let config = {
  headers: {
    header1: value,
  }
}

let data = {
  'HTTP_CONTENT_LANGUAGE': self.language
}

axios.post(URL, data, config).then(...)
Posted by: Guest on November-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language