I am getting response from API using axios in Javascript. However, the problem i am facing is that response is coming as content-type: text/html; charset=UTF-8, I cannot parse the response since it is not JSON. Has anyone faced this problem earlier, i will say thank you if you guys help, Thank you so much.
You can set Accept: application/json in your request headers. Something like
axios.get(url, {
headers: {
Accept: 'application/json'
}
}
It also depends on your back-end. If your back-end doesn't support JSON response, you can't get JSON.