I'm using axios to get contents from an api. I want to set Content-Type to application/json in React using axios. What needs to be corrected? Below is the code for reference.
const config = {
headers: {
'Content-Type': 'application/json',
'accept':'application/json'
},
};
export function getDetails(){
return function (dispatch) {
return axios.get('url',config)
.then(response => {
if (response.status === 200) {
console.log("actions ",response.data);
}
}).catch(err => {
});
}
}