I need to make a CORS post request
. I need to use fetch
because axios
's response
is already processed to json.
But in fetch
response, the headers
is empty. But I don't think this is the server problem since axios
response headers have the values that I want.
Any trick?
fetch('http://localhost:9876/test/sample-download', {
method: 'post',
headers: {},
body: {}
})
.then(response => {
console.log(response);
})
.catch(err => console.error(err));
axios.post('http://localhost:9876/test/sample-download', {}, {})
.then(response => console.log(response))
.catch(error => console.error(error));