Answers for "axios get all headers"

8

header in axios

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

axios defaults headers common

// GET request for remote image
axios({
  method: 'get',
  url: 'http://bit.ly/2mTM3nY',
  responseType: 'stream'
})
  .then(function(response) {
  response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'))
});
Posted by: Guest on April-10-2020

Browse Popular Code Answers by Language