I want to get all string on https://animechan.vercel.app/api/available/anime but suddenly i can't get it, anyone would help me? heres my code:
axios.get('https://animechan.vercel.app/api/available/anime')
.then(response => {
console.log("Source of Anime Qoutes: \n\n\n" + JSON.parse(response.data));
})
.catch(error => {
console.log(error);
});
Axios automagically deserializes the response body from JSON to a Javascript object, assuming the response's content type is application/json or you tell Axios to do so regardless. See the documentation at
https://axios-http.com/docs/intro
All you should need is:
var axios = require("axios");
axios.get( 'https://animechan.vercel.app/api/available/anime' )
.then( response => {
console.log(`Source of Anime Qoutes:`);
console.log( response.data.join('\n') );
})
.catch(error => {
console.log(error);
});