I tried to call external api from Vue js coreui theme but unable receive set-cookie in response.headers
Code is as below
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.headers.common['Access-Control-Allow-Credentials'] = true;
axios.defaults.headers.common['Access-Control-Allow-Origin'] = 'http://127.0.0.1:8000';
axios.defaults.headers.common['Access-Control-Allow-Headers'] = 'X-PINGOTHER, Content-Type';
axios.defaults.headers.common['Access-Control-Expose-Headers'] = 'Access-Token, Uid';
axios.defaults.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS';
axios
.post('url',
{
par : '20'
}, {
withCredentials: true,
})
.then(function(response){
console.log(response);
})
.catch(error => console.log(error))
I tried to use both
axios.defaults.headers.common['Access-Control-Expose-Headers'] = 'Access-Token, Uid';
this and
withCredentials: true,
Response is coming correct but headers not coming different
in developer tools as bellow: developer tools response header
Note: On Postman I get the set-cookie but on application in response not getting.
I tried each and everything related Axios and Vue js but still not getting set-cookies in headers.