I am trying to fetch data from another website with vue axios with the help of API. But I am getting this error
Access to XMLHttpRequest at 'https:URL' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I use vue cors library but it is not working
import Vue from 'vue'
import axios from 'axios';
import {api} from "../../config";
import AxiosPlugin from 'vue-axios-cors';
Vue.use(AxiosPlugin)
export default {
data () {
return {
selected: [],
e7: [],
projects: [],
urls:['/api/abc','api/212'],
apis:[]
}
},
methods:{
getTickets(){
const headers = {
'Content-Type': 'text/plain'
};
this.$axios.get(this.selected+'api/tickets/fetch_tickets').then((res)=>{
console.log(res.data)
})
}
}
}