Help

Import axios javascript not working

2202 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Marc_Justin_Rai
6 - Interface Innovator
6 - Interface Innovator

Hello, i would like to know if my connectivity of importing the axios module javascript is working because i tried this one but it result to blank.

await getAxios()
 async function getAxios() {
  const response = await fetch("https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js");
  const minifiedLibrary= await response.text();
  eval(minifiedLibrary)
}

const ws = "https://api.writesonic.com/v1/business/content/ai-article-writer-v2?&end_user_id=test1&engine=economy&language=en";

let config = {
  method: 'post',
  url : "https://api.writesonic.com/v1/business/content/ai-article-writer-v2?&end_user_id=test1&engine=economy&language=en",
  headers: { 
    'Content-Type': 'application/json', 
    'Accept': 'application/json', 
    'X-API-KEY': 'apikey'
  },
  data : data
};
axios(config).then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
0 Replies 0