Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created November 16, 2017 12:01
Show Gist options
  • Save brunokrebs/d0258f8efed1ad30fce425c6988f3f8d to your computer and use it in GitHub Desktop.
Save brunokrebs/d0258f8efed1ad30fce425c6988f3f8d to your computer and use it in GitHub Desktop.
Accessing headers on a response after a POST request sent by axios
const axios = require('axios');
axios.post('http://localhost:8080/login', {
"username": "admin",
"password": "password"
}).then(function (response) {
console.log(response.headers.authorization);
}).catch(function (error) {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment